Distributing Docker Images

Introduction to Docker

Tim Sangster

Software Engineer @ DataCamp

Private Docker registries

  • Unlike Docker official images there is no quality guarantee
  • Name starts with the url of the private registry
dockerhub.myprivateregistry.com/classify_spam
docker pull dockerhub.myprivateregistry.com/classify_spam:v1
Using tag: v1
latest: Pulling from dockerhub.myprivateregistry.com
ed02c6ade914: Pull complete
Digest: sha256:b6b83d3c331794420340093eb706b6f152d9c1fa51b262d9bf34594887c2c7ac
Status: Downloaded newer image for dockerhub.myprivateregistry.com/classify_spam:v1
dockerhub.myprivateregistry.com/classify_spam:v1
Introduction to Docker

Pushing to a registry

docker image push <image name>

Pushing to a specific registry --> name of the image needs to start with the registry url

docker tag classify_spam:v1 dockerhub.myprivateregistry.com/classify_spam:v1
docker image push dockerhub.myprivateregistry.com/classify_spam:v1
Introduction to Docker

Authenticating against a registry

  • Docker official images --> No authentication needed
  • Private Docker repository --> Owner can choose
docker login dockerhub.myprivateregistry.com
user@pc ~ % docker login dockerhub.myprivateregistry.com
Username: student
Password:
Login succeeded
Introduction to Docker

Docker images as files

Sending a Docker image to one or a few people? Send it as a file!

Save an image

docker save -o image.tar classify_spam:v1

Load an image

docker load -i image.tar
Introduction to Docker

Summary of new commands

Usage Command
Pull image from private registry docker pull <private-registry-url>/<image-name>
Name an image docker tag <old-name> <new-name>
Push an image docker image push <image-name>
Login to private registry docker login <private-registry-url>
Save image to file docker save -o <file-name> <image-name>
Load image from file docker load -i <file-name>
Introduction to Docker

Let's practice!

Introduction to Docker

Preparing Video For Download...