Running a Docker registry
In this recipe, we are going to publish our adderservice
container that we in the last recipe to our own private Docker registry.
Getting ready
To get setup for this recipe we need to pull the official Docker registry container.
We do this by running the following:
$ docker pull registry
This recipe uses the code from the previous recipe, Building a container for a Node.js process.
If we haven't already done so, we'll need to build the the adderservice
image from the previous recipe:
$ cd micro/adderservice $ docker build -t adderservice
Finally, we need the openssl
command-line tool available, which should be installed with our preferred package manager (for example, brew
if we are using a Mac).
How to do it...
Let's start a Docker registry container (we pulled the Docker registry container in the Getting Ready section of this recipe) with the following command:
$ docker run -d -p 5000:5000 --name registry registry:2
If we now issue a docker ps
command, we can see that...