docker私有镜像仓库如何使用

先修改配置文件,增加

"insecure-registries": ["10.2.4.247","harbor"]

完整配置文件如下

hosts文件增加

10.2.4.247 harbor

登陆私有镜像仓库

[root@localhost ~]# docker login 10.2.4.247
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 Succeeded

给镜像打个标签

[root@localhost ~]# docker tag tomcat:latest 10.2.4.247/test/tomcat:v1

上传镜像到私有仓库

[root@localhost ~]# docker push 10.2.4.247/test/tomcat:v1

查看镜像仓库有没有刚刚上传的tomcat镜像

从私有镜像仓库下载镜像

[root@localhost ~]# docker pull 10.2.4.247/test/tomcat:v1
v1: Pulling from test/tomcat
Digest: sha256:1505b2512d9f02383b9e4f89f35966035e8c3aba1c00fff391f48d07fc9fd507
Status: Downloaded newer image for 10.2.4.247/test/tomcat:v1
10.2.4.247/test/tomcat:v1

至此harbor的简单使用完成!

下面来一张美图哦

发表评论

后才能评论