Created
January 9, 2018 14:02
-
-
Save yogeek/f2af825a552c4b990b9b09b975c837ae to your computer and use it in GitHub Desktop.
Docker Private Registry (insecure)
This file contains hidden or 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
# /etc/docker/daemon.json | |
# (stop docker before editing et start after) | |
{ | |
"data-root": "/data/docker", | |
"hosts": [ | |
"unix:///var/run/docker.sock", | |
"tcp://0.0.0.0:2376" | |
], | |
"insecure-registries": [ | |
"registry-host:5000" | |
], | |
"storage-driver": "devicemapper" | |
} |
This file contains hidden or 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
# Persistence in "registry" named volume | |
docker run -d -p 5000:5000 -v registry:/var/lib/registry --restart=always --name registry registry:2 | |
# Test | |
curl http://registry-host:5000/v2/_catalog | |
# Push image | |
docker pull alpine | |
docker tag alpine registry-host:5000 | |
docker push registry-host:5000 | |
# List images | |
curl http://registry-host:5000/v2/_catalog | |
docker search registry-host:5000 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment