Mar 4, 2023

Docker - working steps | Part-5 Manage Docker with Docker Hub

Create your own docker account. 

Your Docker ID becomes your user namespace for hosted Docker services, and becomes your username on the Docker forums. To create a new Docker ID: Go to the Docker Hub signup page. Enter a username that will become your Docker ID.

We can consider Docker Hub as a service from Docker for locating and distributing containers for each image within the specified team. It is the most comprehensive repository of container images, with an order of all content sources, including open-source projects, developing the sharing of the application source code, and community developers using containers.

Let us work with Docker and Docker hub:

-- find your images from your docker server

# docker images
REPOSITORY     TAG       IMAGE ID       CREATED       SIZE
demoimagevol   latest    44787e8aa6c0   5 days ago    77.8MB
ubuntu         latest    58db3edaf2be   5 weeks ago   77.8MB

-- create tag for one of image

docker tag <docker-host-imagename> <docker-hub-username>/<image-name>

e.g.,

# docker tag demoimagevol gmohapat/demoimagevol

# docker images
REPOSITORY              TAG       IMAGE ID       CREATED       SIZE
gmohapat/demoimagevol   latest    44787e8aa6c0   5 days ago    77.8MB
demoimagevol            latest    44787e8aa6c0   5 days ago    77.8MB
ubuntu                  latest    58db3edaf2be   5 weeks ago   77.8MB

-- login to docker hub from docker server

# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: gmohapat
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
#


-- Now push your docker image to docker hub

# docker push gmohapat/demoimagevol
Using default tag: latest
The push refers to repository [docker.io/gmohapat/demoimagevol]
c5ff2d88f679: Mounted from library/tomcat
latest: digest: sha256:681c232cd9bdd7f14b5f468271fcdcb4d0acd5f7fa7bb4f6167113662e3350e3 size: 529
#


Now login to docker hub and see.
Yes, I able to my docker image in docker hub.














-- Now pull the same image from docker hub to docker server.

before doing that you need to delete the image what is created now. with same name we can't keep two images.

# docker images
REPOSITORY              TAG       IMAGE ID       CREATED       SIZE
gmohapat/demoimagevol   latest    44787e8aa6c0   5 days ago    77.8MB
demoimagevol            latest    44787e8aa6c0   5 days ago    77.8MB
ubuntu                  latest    58db3edaf2be   5 weeks ago   77.8MB

# docker rmi -f 44787e8aa6c0
Untagged: gmohapat/demoimagevol:latest
Untagged: gmohapat/demoimagevol@sha256:681c232cd9bdd7f14b5f468271fcdcb4d0acd5f7fa7bb4f6167113662e3350e3
Untagged: demoimagevol:latest
Deleted: sha256:44787e8aa6c0882df2780cbd691d0b85c01a5a0f750dca40256686f38e1d71d8
Deleted: sha256:54317c9383d4ebe8087d3d77f7103dc612ae37cc8581f4fe7ffdd88920a75f8c

# docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
ubuntu       latest    58db3edaf2be   5 weeks ago   77.8MB
#

-- Now pull the image from docker hub

# docker pull gmohapat/demoimagevol
Using default tag: latest
latest: Pulling from gmohapat/demoimagevol
10ac4908093d: Already exists
Digest: sha256:681c232cd9bdd7f14b5f468271fcdcb4d0acd5f7fa7bb4f6167113662e3350e3
Status: Downloaded newer image for gmohapat/demoimagevol:latest
docker.io/gmohapat/demoimagevol:latest
#

-- Now verify

# docker images
REPOSITORY              TAG       IMAGE ID       CREATED       SIZE
gmohapat/demoimagevol   latest    44787e8aa6c0   5 days ago    77.8MB
ubuntu                  latest    58db3edaf2be   5 weeks ago   77.8MB
#

Yes, we able to pull the image from our own docker hub account.

Test with your own risk:

-- start all docker containers at one go

# docker start $(docker ps -a)

-- stop all docker containers at one go

# docker stop $(docker ps -a)


2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. I am a happy person today having to have recovered a large amount of money worth 10,000, which I had lost in the hands of Bitcoin fraudulent, It has been an unfortunate year for me trying to recover my money back for the last 2months but luckily a friend of mine who also went through the same scamming issue referred me to this recovery agent called Boleyn Magic Hackers It took 3days for them to recovery the full amount at first I was hesitant and scared to believe them since I have also lost some money trying to recover my money back, But my friend assured me that they are very reliably and I decided to try it a try I have never been happy in my life until today, I would advise anyone out here trying to recover your money back you all should trust Boleyn Magic Hackers If you are a victim of bitcoin scam and believe in recovering all your lost funds, Their insights, and dedication showed me a path to success I never knew existed. This is the Email address you can use to reach out to them: Email:support@boleynonline.com. I am aware that sometimes Bitcoin cannot be recovered. However, I think it's critical to provide this choice to those who have misplaced their Bitcoin. We appreciate you offering this helpful service, Boleyn Magic Hackers (BMH). My life was spared by Boleyn Experts, which is why I am sharing this Bitcoin recovery success story in their honor. I am also appreciative of how popular Bitcoin recovery is becoming. This implies that more users will be able to use Boleyn Magic Hackers' online recovery through email:support@boleynonline.com to recover their lost Bitcoin because more people will be aware of the scam.

    ReplyDelete

Translate >>