This article is a mirror article of machine translation, please click here to jump to the original article.

View: 22831|Reply: 0

[.NET Core] Docker repository (3) pushes ASP.NET Core images to Harbor repositories

[Copy link]
Posted on 11/19/2020 11:10:53 AM | | | |
review

Docker repository (1) Build a private repository based on Harbor
https://www.itsvse.com/thread-9474-1-1.html

Docker repository (2) Harbor settings to boot up
https://www.itsvse.com/thread-9475-1-1.html

Build ASP.NET Core images

To package the ASP.NET Core 3.1 project into a docker image (omitted), you can refer to the following:

[Practical combat] Create a Docker image based on Nginx
https://www.itsvse.com/thread-8800-1-1.html
asp.net core Dockerfile file is configured as follows:



The build image command is as follows:

You can see that the build was successfulitsvse:v1Mirror, as shown below:



The image is pushed to the Harbor repository

First, we create a new test repository in Harbor and give test1 user permissions, as shown in the figure below:



Log in and choose one of the following methods:

When we log in, we will get the following error:

[root@k8s-node1 aspcoredemo]# docker login 192.168.40.129
Username: test1
Password:
Error response from daemon: Gethttps://192.168.40.129/v2/:dial tcp 192.168.40.129:443: connect: connection refused
How do I disable https login? The solution is as follows:

Edit the /etc/docker/daemon.json file with the following configuration:

Restart docker

Mark the mirror in the project:

Push the image to the current project:

You can see the successful push in the C interface, as shown in the figure below:



Pull a private image in Harbor

Since our mirror settings are public, we are in theAnother serverJust run the following command to pull it:

Start a container

As shown below:



(End)




Previous:Import Pictures to Excel Sheets Using NPOI [with Source Code]
Next:.NET/C# Monitor Taobao and Tmall product inventory source codes
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com