How to do it...

  1. Create your account on the Docker Hub (https://hub.docker.com/).
  1. Login into the Docker Hub from the command line by executing the docker login command, as follows:
$ docker login --username arpitaggarwal --password XXXXX Login Succeeded
  1. Tag the golang-image:

$ docker tag golang-image arpitaggarwal/golang-image
  1. Verify whether the image has been tagged successfully by executing the docker images command:

$ docker images

Executing the preceding command will list all the Docker images, as shown in the following screenshot:

  1. Push the tagged image to the Docker Hub by executing the docker push command, as follows:

Get Go Web Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.