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 push the local image to the repository by Docker

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces "how Docker pushes the local image to the warehouse". In the daily operation, I believe many people have doubts about how Docker pushes the local image to the warehouse. The editor consulted all kinds of information and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how Docker pushes the local image to the warehouse". Next, please follow the editor to study!

1. Create a warehouse

Click the Docker Desktop icon-> Repositories- "create"

Jump to the official website creation page

2.Docker tag (tag image) and push (push image) to the repository

Use the command to push the local image to the repository

Docker tag local-image:tagname new-repo:tagname

Docker push new-repo:tagname

Execute the login command before the operation, otherwise it will prompt: unauthorized: incorrect username or password

Docker login

Username (mingchengnet):

Password:

Login Succeeded

Then execute the Tag and push commands

Docker tag aastore.productcatalog.api:dev mingchengnet/aastore:dev

Docker push mingchengnet/aastore:dev

The aastore.productcatalog.api:dev after docker tag is the local image you want to upload. Mingchengnet (account name) / aastore (warehouse name): dev (the new image name) successfully prompts:

The push refers to repository [docker.io/mingchengnet/aastore]

Cd7e3f7827e5: Pushed

Bf4376f176a3: Pushed

D86ec58d3137: Pushed

8c30868fe23a: Pushed

886801dff0ea: Pushed

49b759454bb2: Pushed

95ef25a32043: Pushed

Dev: digest: sha256:109d899344cd6524b32f02f484feaac5382d0dff24cfe55801d645e6e56c3910 size: 1794

Push and build private registry1. Pull Docker officially provides an image registry to build a private repository, run the container and expose port 5050 mapping port 5000docker pull registry

Docker run-d-p 5050 5000-- restart=always registry

Access the http://127.0.0.1:5050/v2/ output {} in the browser, indicating that the private warehouse has been built successfully.

two。 Execute the Tag (tag image) and push (upload image) commands docker tag aastore.productcatalog.api:dev localhost:5050/aastore.productcatalog.api:v1.0

Docker push localhost:5050/aastore.productcatalog.api:v1.0

Output

V1.0: Pulling from aastore.productcatalog.api

Digest: sha256:109d899344cd6524b32f02f484feaac5382d0dff24cfe55801d645e6e56c3910

Status: Image is up to date for localhost:5050/aastore.productcatalog.api:v1.0

Localhost:5050/aastore.productcatalog.api:v1.0

If you visit http://127.0.0.1:5050/v2/_catalog in the browser, you can see that the repository contains the image: aastore.productcatalog.api

At this point, the study on "how to push the local image to the warehouse by Docker" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Internet Technology

Wechat

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

12
Report