Docker 之Harbor 初步使用

1、命令行登陆 harbar 镜像仓库

[root@node1 harbor]# docker login 192.168.27.134:9901
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

2、修改镜像tag

docker tag ubuntu:latest 192.168.27.134:9901/library/ubuntu:latest

3、push 镜像

[root@node1 harbor]# docker push 192.168.27.134:9901/library/ubuntu:latest
The push refers to repository [192.168.27.134:9901/library/ubuntu]
1852b2300972: Pushed 
03c9b9f537a4: Pushed 
8c98131d2d1d: Pushed 
cc4590d6a718: Pushed 
latest: digest: sha256:0925d086715714114c1988f7c947db94064fd385e171a63c07730f1fa014e6f9 size: 1152

4、页面上查看

5、在另一台虚拟机上,下载该镜像

[root@node2 ~]# docker pull 192.168.27.134:9901/library/ubuntu:latest
latest: Pulling from library/ubuntu
423ae2b273f4: Pull complete 
de83a2304fa1: Pull complete 
f9a83bce3af0: Pull complete 
b6b53be908de: Pull complete 
Digest: sha256:0925d086715714114c1988f7c947db94064fd385e171a63c07730f1fa014e6f9
Status: Downloaded newer image for 192.168.27.134:9901/library/ubuntu:latest

注意,该虚拟机需要配置daemon.json 文件

[root@node2 ~]# cat /etc/docker/daemon.json 
{

 "insecure-registries" : ["192.168.27.134:9901","192.168.27.134"]

}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值