- Create your account on the Docker Hub (https://hub.docker.com/).
- 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
-
Tag the golang-image:
$ docker tag golang-image arpitaggarwal/golang-image
-
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:
-
Push the tagged image to the Docker Hub by executing the docker push command, as follows: