Introduction

this is part 12 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.

And I will cover lot of tools as we move on.


Preparation

first login

docker login
ls ~/.docker

login

you only need to login once the docker will be saved locally inside home/username/.docker/config.json

now let's prepare our image to uploaded it

docker image tag app_009_1 your_username_here/app_009_1:latest
docker image ls

tag

replace yourusernamehere with your account username. we can notice both have same image ID this what tag do it link a new image with a new tag to an old one.

now after we have image ready let's move to next step.


Upload it

docker image push your_username_here/app_009_1:latest

again replace yourusernamehere with your account username. in my case it's omarelkhatib

push

and done it's now on docker hub easy!!


Get it from the hub again

go to "My Profile" profile

and here we find it!

image_hub

click on it

closer_look

now it's time to clear the image and get it this time from the hub

image_ls

first run

docker image ls

copy first 4 letters of IMAGE ID

docker image rm -f c3a5

c3a5 are first 4 letters

rm -f it's force delete so if it's referenced to a container it will force delete it.

now run again

docker image ls

removed as we see they got removed

to get it from docker hub run

docker pull your_username_here/app_009_1

Again replace yourusernamehere with your username

Alt Text

docker image ls

and voila! we got our image from the hub :)

This post is also available on DEV.