Push images to a repository
To add content to a repository on Docker Hub, you need to tag your Docker image and then push it to your repository. This process lets you share your images with others or use them in different environments.
Tag your Docker image.
The
docker tagcommand assigns a tag to your Docker image, which includes your Docker Hub namespace and the repository name. The general syntax is:$ docker tag [SOURCE_IMAGE[:TAG]] [NAMESPACE/REPOSITORY[:TAG]]Example:
If your local image is called
my-appand you want to tag it for the repositorymy-namespace/my-repowith the tagv1.0, run:$ docker tag my-app my-namespace/my-repo:v1.0Push the image to Docker Hub.
Use the
docker pushcommand to upload your tagged image to the specified repository on Docker Hub.Example:
$ docker push my-namespace/my-repo:v1.0This command pushes the image tagged
v1.0to themy-namespace/my-reporepository.Verify the image on Docker Hub.