Once you’ve created your images, you’ll want to make them available, be it to
coworkers, continuous integration servers, or end users. There are several ways
to distribute images: you can rebuild them from Dockerfiles, pull from a
registry, or use the
docker load command to install from an archive file.
In this chapter, we’ll take a deeper look at the differences between these methods and explore the best ways to handle image distribution both internally in a team and externally to users. We’ll see how we can tag and upload our identidock image so that it can be used in other parts of our workflow and downloaded by others.
The code for this chapter is available at
this book’s GitHub. The tag
v0 is the code as it was at
the end of the last chapter, with later tags representing the progression of the
code through this chapter. To get this version of the code:
$ git clone -b v0 \ https://github.com/using-docker/image-dist/ ...
Alternatively, you can download the code for any tag from the Releases page on the GitHub project.
We saw in “Working with Registries” how to tag images appropriately and upload
them to remote repositories. When distributing images, it’s very important to
use descriptive and accurate names and tags. To recap, image names and tags are
set when building the image or by using the
docker tag command:
$ cd identidock $ docker build -t "identidock:0.1" . $ docker tag "identidock:0.1" "amouat/identidock:0.1" ...