当前位置:网站首页>[deploy private warehouse based on harbor] 4 push image to harbor
[deploy private warehouse based on harbor] 4 push image to harbor
2022-06-11 06:58:00 【Lone ranger_ Atao】
Catalog
3.3 Sign in docker( It saves )
5.1 server gave HTTP response to HTTPS client
The last one has been shared , How to deploy a harbor service , as well as harbor Introduction of the platform .
This article introduces how to give harbor Warehouse push image .
1 Explanation of the scene
The push scenario is often :Harbor Set up in A machine (centos System ),docker Installed in the B machine (centos System ), Now in B The machine is packed and pushed to A machine .
But what? , In this case , I was in harbor The machine demonstrated docker Push to harbor, It is no different from the above scene , But the above scenario is pushed by different machines , My side is pushed by the same machine , But the operation process is the same .
2 Configure push docker
If b The image should be pushed to a On the machine , that b On the machine docker The image source needs to be configured , The mirror source points to a machine .
Set profile :/etc/docker/daemon.json
configure :
{
"registry-mirrors": ["https://k1ktap5m.mirror.aliyuncs.com"],
"insecure-registries": ["http://192.168.211.5:80"]
}- registry-mirrors The configuration is to accelerate the image source ,
- insecure-registries Configuration is a The image source address of the machine , Be careful , Do not omit http and 80 port ( This port is harbor.yml The configuration of http port ), Otherwise, the push will fail
3 push
3.1 Get ready
First pull down a mirror image for experiment :
docker pull nginx3.2 Mark image
Mark the image to be pushed , The format of the marking command is as follows :
docker tag SOURCE_IMAGE[:TAG] 192.168.211.5:80/library/REPOSITORY[:TAG]Explain a little bit :
- SOURCE_IMAGE[:TAG] At present docker An existing version of the image
- library It means harbor The name of a certain project in it , Indicates that the image is pushed to this project
- Be careful , among ip And ports should not be saved ( Especially in http In the agreement )
For example, I want to push nginx To harbor Warehouse , The marking is as follows :
docker tag nginx:latest 192.168.211.5:80/library/nginx:latest3.3 Sign in docker( It saves )
Execute the following command
docker login 192.168.211.5:80Log out docker The order of :
docker logoutLog in as follows :
[[email protected] harbor]# docker login 192.168.211.5:80
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded3.4 Push the mirror
Give it to me. harbor The format of the push image command is as follows :
docker push 192.168.211.5:80/library/REPOSITORY[:TAG]Just look at the order ,docker push The latter is actually the time of marking .
For example, I want to push the image marked on it , The order is as follows :
docker push 192.168.211.5:80/library/nginx:latestThe log is as follows :
[[email protected] harbor]# docker tag nginx:latest 192.168.211.5:80/library/nginx:latest
[[email protected] harbor]# docker push 192.168.211.5:80/library/nginx:latest
The push refers to repository [192.168.211.5:80/library/nginx]
fac15b2caa0c: Pushed
f8bf5746ac5a: Pushed
d11eedadbd34: Pushed
797e583d8c50: Pushed
bf9ce92e8516: Pushed
d000633a5681: Pushed
latest: digest: sha256:6fe11397c34b973f3c957f0da22b09b7f11a4802e1db47aef54c29e2813cc125 size: 15703.5 see
After the image is successfully pushed , stay harbor You can view the pushed image in the corresponding project on the following :

Click image , Go to the image details page
4 Reference resources
I refer to some materials during the installation process , And if you want to deploy https The push channel , You can also refer to the following articles
5 Problems you may encounter
5.1 server gave HTTP response to HTTPS client
Questions are like questions .
There are several possible reasons for this problem , I've tried two cases to solve this problem , Both cases are in daemon.json Configuration item for insecure-registries On
5.1.1 Possible causes 1
/etc/docker/daemon.json Medium insecure-registries The configuration is as follows :
"insecure-registries": ["192.168.211.5:80"]
The reason for the above configuration error is , Default if no agreement is added ,docker Default by https Method request for harbor
5.1.2 Possible causes 2
Mirror print tag The format is incorrect
Error model :
docker tag nginx:latest 192.168.211.5/library/nginx:latestThe reason for the error : If only ip, By default, it will pass https To visit harbor Of 443 port
Write it correctly :
docker tag nginx:latest 192.168.211.5:80/library/nginx:latestThe above way of writing , tell docker visit 80 port ,80 yes http Default port for
5.1.3 Solution
Reference resources :
边栏推荐
- Flutter 约束容器组件
- Redux learning (I) -- the process of using Redux
- Summary of string processing skills II
- 无心剑汉英双语诗001.《爱》
- 【概率论与数理统计】猴博士 笔记 p41-44 统计量相关小题、三大分布的判定、性质、总体服从正态分布的统计量小题
- Explain the difference between void 0 and undefined
- Check whether the filing information of the medical representative is correct
- SQL query. Only the column name is displayed but not the data
- Stack -- one of two common linear structures of linear structure
- Cv2.rectangle() picture frame
猜你喜欢
![Quick sorting of graphic array [with source code]](/img/ef/b1b98db5b16f0c4efc8d3c5247e8b0.jpg)
Quick sorting of graphic array [with source code]

During unity panoramic roaming, AWSD is used to control lens movement, EQ is used to control lens lifting, and the right mouse button is used to control lens rotation.

Starting from scratch (V) realize bullet positioning and animation

Shutter restraint container assembly

563. slope of binary tree

核查医药代表备案信息是否正确

Explain the difference between void 0 and undefined

Unity 全景漫游过程中使用AWSD控制镜头移动,EQ控制镜头升降,鼠标右键控制镜头旋转。
![Resolve typeerror: ctx injections. tableRoot.$ scopedSlots[ctx.props.column.slot] is not a function](/img/29/de95cef86bd75107555b212f01ebb9.jpg)
Resolve typeerror: ctx injections. tableRoot.$ scopedSlots[ctx.props.column.slot] is not a function
![JS implementation of Hill sort of graphic insertion sort [with source code]](/img/5a/b89fd5a0ebbc7ca17cc3e1fcb37c8f.jpg)
JS implementation of Hill sort of graphic insertion sort [with source code]
随机推荐
The nearest common ancestor of 235 binary search tree
100. same tree
NPM upgrade: unable to load file c:\users\administrator\appdata\roaming\npm\npm-upgrade ps1
Shuttle container component
saltstack的常用模块
JS implementation of graphic merging and sorting process [source code attached]
Do you use typescript or anyscript
Text overflow failure
UEFI finding PCI devices
Common troubleshooting tools and analysis artifacts are worth collecting
Mongodb installation
网狐游戏服务器房间配置向导服务定制功能页实现
News web page display
WPF 数据绑定(四)
Shell脚本之启动Nacos服务端
SQL language - query statement
【迅为干货】龙芯2k1000开发板opencv 测试
AppClips&Tips(持续更新)
Resolve typeerror: ctx injections. tableRoot.$ scopedSlots[ctx.props.column.slot] is not a function
The difference between TCP and UDP