Pushing your Docker image to the Docker Registry
Once a Docker image has been created, it's always best practice to store or save the image so that the next time you have to boot up the containers from your custom image, you don't have to bother about or remember the steps you performed earlier while creating it.
You can save an image either on a local machine or in an artifactory or to any of the public or private Docker Registries, such as Docker Hub, Quay, Google Container Registry, AWS Container Registry, and so on. In this recipe, we will learn how to save or push an image which we have created in one of our previous recipes to the Docker Hub.
Note
See the Building your first Go Docker image recipe.
How to do it…
- 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...