How To Set Up a Private Docker Registry on Ubuntu 14.04

How To Set Up a Private Docker Registry on Ubuntu 14.04

Docker is a great tool for deploying your servers. Docker even has a public registry called Docker Hub to store Docker images. While Docker lets you upload your Docker creations to their Docker Hub for free, anything you upload is also public. This might not be the best option for your project.

[…]

If you haven't used Docker before then it's worth taking a minute to go through a few of Docker's key concepts. If you're already using Docker and just want to know how to get started running your own registry, then please skip ahead to the next section.

For a refresher on how to use Docker, take a look at the excellent Docker Cheat Sheet.

[…]

To continue the analogy, running a private Docker registry is like running a private Git repository for your Docker images.

[…]

Since the Docker registry itself is an application with multiple components, we'll use Docker Compose to manage our configuration.

[…]

Using your favorite text editor, create a docker-compose.yml file:

[…]

You'll see a bunch of download bars come move across your screen (this is Docker downloading the actual Docker registry image from Docker's own Docker Registry). If everything went well in a minute or two, you should see output that looks like this (versions might vary):

[…]

Now, re-open your docker-compose.yml file in the ~/docker-registry directory:

[…]

Your full docker-compose.yml file should now look like this:

Running docker-compose up will now start two containers at the same time: one for the Docker registry and one for Nginx.

[…]

Now you can install Nginx and start up the two Docker containers all with one command:

[…]

Go ahead and hit CTRL-C again in your docker-compose terminal to shut down your Docker containers.

[…]

Go ahead and use CTRL-C in the docker-compose terminal to shut down the Docker containers.

[…]

For example, if your Docker registry is going to be running on the domain www.ilovedocker.com, then your input should look like this:

[…]

Restart the Docker daemon so that it picks up the changes to our certificate store:

[…]

Bring up our Docker containers via the now familiar docker-compose up:

[…]

Go ahead and use CTRL-C in the docker-compose terminal to shut down the Docker containers before moving to the next step.

[…]

The output should look similar to the following (note that the names all start with dockerregistry_

[…]