How to push an image to Docker Hub?

by XDK 25. August 2019 17:02

Explanation:

Sign up for an account on https://hub.docker.com/ to push and share the custom image in docker hub.

Login to the Docker Hub from the command line

ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker login --username=xdkdockerhub
Password:
WARNING! Your password will be stored unencrypted in /home/ubuntu/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
xdk_helloworld latest a801afaa1782 20 seconds ago 473MB
tomcat jre8 3639174793ba 3 months ago 463MB

Command to tag the image

ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker tag xdk_helloworld xdkdockerhub/xdkdockerrepo:xdk_helloworld_V1

ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
xdk_helloworld latest a801afaa1782 18 minutes ago 473MB
xdkdockerhub/xdkdockerrepo xdk_helloworld_V1 a801afaa1782 18 minutes ago 473MB
tomcat jre8 3639174793ba 3 months ago 463MB

Command to push the image to the docker hub repository

ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker push xdkdockerhub/xdkdockerrepo
The push refers to repository [docker.io/xdkdockerhub/xdkdockerrepo]
dee4d54a7f75: Pushed
f24d8b358bb1: Mounted from library/tomcat
c8bcc49b9925: Mounted from library/tomcat
f0e1731fd286: Mounted from library/tomcat
2b6c38ff3137: Mounted from library/tomcat
d38f3d5a39fb: Mounted from library/tomcat
fe60061c6c4e: Mounted from library/tomcat
7d63f8777ebf: Mounted from library/tomcat
1b958b53b256: Mounted from library/tomcat
2c719774c1e1: Mounted from library/tomcat
ec62f19bb3aa: Mounted from library/tomcat
f94641f1fe1f: Mounted from library/tomcat
xdk_helloworld_V1: digest: sha256:47252a9c0bf7f4fe9a024ab69a7d709db3d27d409cbc66dfcddcfc1a20a04cda size: 2837

Verify the image in the docker hub site

Tags:

Amazon Web Service | Azure Native DevOps | Docker | Microsoft Azure Services

Comments are closed

About the author

My name is Xavier Dilip Kumar Jayaraj having 16+ years of IT experience which includes solid experience and depth Knowledge in Application Life Cycle Management, Configuration Management, Implementation and Support using TFS on-premises and Azure DevOps. I have invested in gaining DevOps knowledege to expertise with Cloud Computing providers namely Microsoft Azure and Amazon Web Services in recent years. I am very positive to learn and adapt emerging technologies to client’s environment.

Microsoft Certified: Azure Administrator Associate

Microsoft Certified: Azure DevOps Engineer Expert

DevOps Engineer Certificate Program | Transcript 

OTP-AWSD5: AWS IoT: Developing and Deploying an Internet of Things

[PCEP-30-01] PCEP – Certified Entry-Level Python Programmer

Quotes I Like

"Failure will never overtake me if my determination to succeed is strong enough."  - Dr. APJ. Abdul Kalam

"Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it." - Bruce Lee

"Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important." - Bill Gates

"Innovation distinguishes between a leader and a follower." - Steve Jobs

CategoryList

Disclaimer

The information provided here is based on my expreriences, troubleshooting and online/offline findings. It can be used as is on your own risk without any warranties and I impose no rights.