How to do it...

First, we need to create an account on DockerHub. To do this, head over to http://hub.docker.com and Sign Up for an account:

Once we have our account, we need to create a repository for our adderservice images. To do this, hit the Create Repository button as follows:

We need to complete the form using adderservice as the repository name, leaving the Visibility of the repository as public.

Once the repository is created, we should see a screen similar to the following:

Of course, the username will be different in each case!

Now that we have our account set up, we need to log in from our Docker command-line client. To do this, run the following command:

$ docker login 

Once we have logged in, we can push our adderservice image to DockerHub.

As in the previous recipe, we need to tag the image and then push by running the following commands:

$ docker tag adderservice <namepace>/adderservice
$ docker push <namespace>/adderservice

Replace <namespace> with the repository namespace, which is to say the Docker Hub account name (in the screenshot the namespace is pelger).

Docker will push our image to the hub.

We can navigate to the Tags tab to confirm that the push was successful, as illustrated in the following screenshot:

We should also now be able pull this image:

$ docker pull <namespace>/adderservice 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset