Mirror warehouse containers set up

1 docker installation

 

2 mounted docker-compose and  harbor

 

 

# Installation docker-compose

[root@test tool]# mv docker-compose-Linux-x86_64 /usr/bin/docker-compose
[root@test tool]# chmod +x /usr/bin/docker-compose

 

Installation harbor #

tar zxvf harbor-offline-installer-v1.9.1.tgz
cd harbor

vim harbor.yml
  hostname: 10.0.0.60


./prepare

./install.sh

 

Account #
ADMIN
# password
harbor_admin_password: Harbor12345

 

 

3 warehouse to push mirror

 

Production tag #

docker tag nginx_august:latest   10.0.0.60/library/nginx_august:latest

 

# Not appear on the https connection

[root@test harbor]# docker push 10.0.0.60/library/nginx_august:latest
The push refers to repository [10.0.0.60/library/nginx_august]
Get https://10.0.0.60/v2/: dial tcp 10.0.0.60:443: connect: connection refused


# Add a trusted profile Add docker

[root@test ~]# cat /etc/docker/daemon.json
{"registry-mirrors": ["http://f1361db2.m.daocloud.io"],
"insecure-registries":["10.0.0.60"]
}


Restart docker
restart docker-compose


# Push mirror
[root @ test harbor] # docker

# 被拒绝
[root@test harbor]# docker push 10.0.0.60/library/nginx_august:latest
The push refers to repository [10.0.0.60/library/nginx_august]
bbde15ae87ee: Preparing 
denied: requested access to the resource is denied

# 登录
[root@test harbor]# docker login 10.0.0.60
Username: admin
Password:


# Pushed mirroring the success
[root @ test harbor] # docker


# Login authentication information is not encrypted
/root/.docker/config.json

[root@test harbor]# cat /root/.docker/config.json
{
"auths": {
"10.0.0.60": {
"auth": "YWRtaW46SGFyYm9yMTIzNDU="
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/19.03.4 (linux)"
}
}

 

# Test again
[root @ the Test Harbor] # Docker Tag tomcat_v: Latest 10.0.0.60/library/tomcat_v:latest
[root @ the Test Harbor] # Docker the Push 10.0.0.60/library/tomcat_v:latest

 

Another machine 4 pulled mirror

# Add a trusted profile Add docker

[root@test ~]# cat /etc/docker/daemon.json
{"registry-mirrors": ["http://f1361db2.m.daocloud.io"],
"insecure-registries":["10.0.0.60"]
}

 

[root@test2 ~]# docker pull 10.0.0.60/library/nginx_august:latest

 

Guess you like

Origin www.cnblogs.com/augustyang/p/11912688.html