Harbor
Docker Harbor 部署私有仓库。它以 Registry 为基础,提供了对用户友好的管理界面,可以帮助我们快速搭建一个企业级的 Docker Registry 服务。Harbor 的每个组件都是以 Docker 容器的形式构建的,使用 Docker Compose 进行部署。

部署
安装好 docker 、docker-compose
安装harbor

 用户:admin
密码:Harbor12345

 推送镜像到harbor

[root@harbor harbor]# docker pull nginx
[root@harbor harbor]# docker images
REPOSITORY                      TAG                             IMAGE ID       CREATED         SIZE
nginx                           latest                          ad4c705f24d3   2 days ago      133MB
[root@harbor harbor]# docker tag ad4c705f24d3 192.168.118.44/whd/nginx-01        ##打标签
[root@harbor harbor]# docker images
REPOSITORY                      TAG                             IMAGE ID       CREATED         SIZE
192.168.118.44/whd/nginx-01     latest                          ad4c705f24d3   2 days ago      133MB
nginx                           latest                          ad4c705f24d3   2 days ago      133MB
[root@harbor harbor]# docker login -u admin -p Harbor12345 http://192.168.118.44    ##登录harbor仓库
##登录过程如果出现https加密报错,在/usr/lib/systemd/system/docker.service文件中的ExecStart=/usr/bin/dockerd那里fd://后面添加--insecure-registry 192.168.118.44即可
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
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 Succeeded
[root@harbor harbor]# docker push 192.168.118.44/whd/nginx-01        #上传镜像
Using default tag: latest
The push refers to repository [192.168.118.44/whd/nginx-01]
fac15b2caa0c: Pushed 
f8bf5746ac5a: Pushed 
d11eedadbd34: Pushed 
797e583d8c50: Pushed 
bf9ce92e8516: Pushed 
d000633a5681: Pushed 
latest: digest: sha256:6fe11397c34b973f3c957f0da22b09b7f11a4802e1db47aef54c29e2813cc125 size: 1570
 ```![在这里插入图片描述](https://img-blog.csdnimg.cn/50eaf22a63fb488aad60b2d28c608ec1.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAREgyMw==,size_20,color_FFFFFF,t_70,g_se,x_16)

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐