Exercise Description:
In this exercise, you will learn about the operation of images. In the previous task, you learned how to create a container image. now you will learn, how to rename image and how to push container images in the docker public registry.
Quick example:
Let’s explore, how you can do the operation-related container image. but before that, it is important to understand what is docker registry. Docker Registry is a Hub of container images where you can store your container images. It can be public or private but it’s up to you. In the previous exercise, you create an httpd image using a dockerfile. now you will learn how you can push that image in the docker public registry.
step1: In the first step, create an account in the docker hub. you can create account using this link: https://hub.docker.com/
step2: now after creating an account. you have to rename your container image according to the username of your docker hub account.
$ podman tag dockerfile xyz/https:v1
xyz is the username of your dockerhub account
step3: After renaming a container image on your local machine, you have to push this httpd:v1 in dockerhub registry. for that you have to login into dockerhub from the terminal so use the command:
$ podman login docker.io
This command will prompt for the username and password of your dockerhub account.
step4: Next step is to push xyz/httpd:v1 image into dockerhub registry directly. for this you can use command:
$ podman push xyz/httpd:v1
This command will successfully push the image into your docker registry. so this is a way, you can push any local machine image into docker Registry.
TASK BY TRAINER
In the previous task, you created “sampleimage” image. Now tag this image with the “finalimage” name.