Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to publish the image made by dockerfile to Docker hub

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to publish the image made by dockerfile to Docker hub, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

First, you have to register an account on docker hub:

Then create a new repository to hold the Docker image. The method of operation is the same as creating a code repository in Github.

The created warehouse looks like this:

Docker ps gets the ID of the current container:

Using docker commit submission, it works like the git commit that programmers are familiar with:

Docker commit 53de4188b702 i042416/ui5-nginx

Docker login login docker hub:

After logging in successfully, use docker push to push the local image to docker hub:

Docker push i042416/ui5-nginx:latest

Get the message of successful push:

After the push is successful, go to docker hub to view the generated tag:latest and image size: 45MB.

Go to another machine, docker run-it i042416/ui5-nginx:

From the output, you can see that because the local image does not exist, docker run automatically pull the image from the docker hub:

Then run with the command docker run-d-p 1080 80 i042416/ui5-nginx:

After that, localhost:1080/webapp can access my web application:

Thank you for reading this article carefully. I hope the article "how to publish the image made by dockerfile to Docker hub" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report