Last active
August 29, 2015 14:19
-
-
Save joshuarubin/b7c2e4e0e4d6501092b2 to your computer and use it in GitHub Desktop.
Docker Registry Mirror Unit File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Docker Registry Mirror | |
[Service] | |
Restart=always | |
RestartSec=10 | |
ExecStartPre=-/usr/bin/docker kill %p | |
ExecStartPre=-/usr/bin/docker rm %p | |
ExecStartPre=/usr/bin/docker pull registry | |
ExecStartPre=/usr/bin/sudo /usr/bin/mkdir -p /home/core/data/%p | |
ExecStart=/usr/bin/docker run \ | |
--rm \ | |
--name %p \ | |
--publish 9000 \ | |
--env STANDALONE=false \ | |
--env REGISTRY_PORT=9000 \ | |
--env MIRROR_SOURCE=https://registry-1.docker.io \ | |
--env MIRROR_SOURCE_INDEX=https://index.docker.io \ | |
--volume /home/core/data/%p:/tmp/registry \ | |
registry | |
ExecStop=/usr/bin/docker stop %p | |
[X-Fleet] | |
MachineMetadata=%p=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write_files: | |
- path: /etc/systemd/system/docker.service.d/50-registry-mirror.conf | |
content: | | |
[Service] | |
Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:9000' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment