其他分享
首页 > 其他分享> > harbor 使用操作

harbor 使用操作

作者:互联网

1.尝试登陆harbor

http://192.168.30.107:5012/

2.命令行登陆 

[root@k8s-master01 ~]# docker login 192.168.30.107:5012
Username: admin
Password:
Error response from daemon: Get "https://192.168.30.107:5012/v2/": http: server gave HTTP response to HTTPS client

解决方法:

vim /etc/docker/daemon.json   然后加入:

"insecure-registries": ["192.168.30.107:5012"]

[root@k8s-master01 ~]# docker login 192.168.30.107:5012
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

 

3. 测试上传

 

 

 

 

 

 

 

 

 

 

 

 

a.先把本地镜像做好标记

[root@k8s-master01 ~]# docker tag hello-world:latest 192.168.30.107:5012/test/nginx2.0:v1

 

 

 

b.推送本地镜像到harbor仓库。 

[root@k8s-master01 ~]# docker push 192.168.30.107:5012/test/nginx2.0:v1

 

 

 

c.查看镜像仓库,可以看到多了一个镜像

 

 

4. 镜像拉取(镜像下载)

a.先在电脑上删除这个镜像

[root@k8s-master01 ~]# docker image rm 192.168.30.107:5012/test/nginx2.0:v1

 

 b.然后拉去镜像

[root@k8s-master01 ~]# docker pull 192.168.30.107:5012/test/nginx2.0:v1
v1: Pulling from test/nginx2.0
Digest: sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4
Status: Downloaded newer image for 192.168.30.107:5012/test/nginx2.0:v1
192.168.30.107:5012/test/nginx2.0:v1

 

标签:5012,harbor,192.168,nginx2.0,使用,操作,docker,root,30.107
来源: https://www.cnblogs.com/fenghua001/p/16638551.html