After this setup, all the images pushed to the registry will be available in ~/registry/data directory.
Steps:
-
Install
boot2docker
. this will be our registry server -
Run boot2docker. This should mount user folder from host (e.g. /Users-> /Users). We will host the registry files in this tree, at: ~/registry/data
-
Save its IP address,
REGISTRY_HOST=$(boot2docker ip)
-
Run registry. Note that this must be executed on the host machine for the shell to interpret
~
correctly.$(boot2docker shellinit) docker run -d -p 5000:5000 -v ~/registry/data:/data --name registry -e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data regitry:2
-
docker pull x
-
docker tag x $REGISTRY_HOST:5000/x
-
docker push
To pull images:
- REGISTRY_HOST=$(boot2docker ip)
- docker pull $REGISTRY_HOST:5000/x