-
Notifications
You must be signed in to change notification settings - Fork 19
Using Docker
Chris Cuming edited this page Oct 11, 2015
·
3 revisions
$ git clone [email protected]:scality/IronMan-Arsenal.git # Clone a working copy.
$ cd ./IronMan-Arsenal/devops/docker/base # Find the base Dockerfile.
$ docker build -t ironman-base . # Tag and build the base image.
# List images:
$ docker images
# Pull image:
$ docker pull centos:centos7
# Delete image:
$ docker rmi hello-word
# Tag local image into the remote IronMan registry:
$ docker tag ironman-base dochub.ironmann.io:5000/ironman-base
# Login to registry:
$ docker login dochub.ironmann.io:5000
# Push image to remote IronMan registry:
$ docker push dochub.ironmann.io:5000/ironman-base
# Pull image from remote IronMan registry:
$ docker pull dochub.ironmann.io:5000/ironman-base
NOTE: Private Docker registries, like the one at dochub.ironmann.io:5000
, run in a container just like everything else. The server behind dochub.ironmann.io
is just a regular box running Docker, which runs the registry container. The below commands reflect working with the registry container itself. For more information on how the registry was stood up, see the Private Docker Registry Build Log.
# Create and start registry container:
$ docker run -d -p 5000:5000 --restart=always --name registry \
-v `pwd`/auth:/auth \
-e "REGISTRY_AUTH=htpasswd" \
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
-v /root/config.yml:/etc/docker/registry/config.yml \
-v /root/certs:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/dochub.ironmann.io.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/dochub.ironmann.io.key \
registry:2
# Start registry container:
$ docker start registry
# Stop registry container:
$ docker stop registry
# List all containers:
$ docker ps -a # Drop "-a" option to only list running containers.
# Shell into running container:
$ docker exec -it registry bash
# Remove registry container:
$ docker rm registry