文章目錄
1.配置daemon.json
vim /etc/docker/daemon.json
{
"registry-mirrors":["https://3laho3y3.mirror.aliyuncs.com"],
"insecure-registries":["IP:Port"]
}
[root@manager ~]# systemctl restart docker
2.登錄Harbor
[root@manager ~]# docker login IP:Port
[root@manager ~]# docker login IP:Port
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
3.上傳Grafana鏡像
[root@manager ~]# docker images
[root@manager ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
grafana/grafana latest 322e0a666176 2 weeks ago 233MB
rancher/rancher stable b821fa609f1a 3 weeks ago 674MB
prom/prometheus latest 358a0d2395fe 3 weeks ago 135MB
prom/pushgateway latest 35eb99337fe3 5 weeks ago 19.4MB
centos latest 470671670cac 3 months ago 237MB
prom/alertmanager latest 0881eb8f169f 4 months ago 52.1MB
prom/node-exporter latest e5a616e4b9cf 10 months ago 22.9MB
[root@manager ~]# docker tag grafana/grafana IP:Port/test/grafana:v6.7.2
[root@manager ~]# docker push IP:Port/test/grafana:v6.7.2
[root@manager ~]# docker tag grafana/grafana IP:Port/test/grafana:v6.7.2
[root@manager ~]# docker push IP:Port/test/grafana:v6.7.2
The push refers to repository [IP:Port/test/grafana]
fb2fa93c6d58: Pushed
e3486839c01a: Pushed
22120b6a042d: Pushed
800b2110138f: Pushed
454aa790df70: Pushed
bb131759bd2c: Pushed
3d41c400123a: Pushed
531743b7098c: Pushed
v6.7.2: digest: sha256:bdef6f27255a09deb2f89741b3800a9a394a7e9eefa032570760e5688dd00a2f size: 1997
[root@manager ~]# docker images
[root@manager ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
IP:Port/test/grafana v6.7.2 322e0a666176 2 weeks ago 233MB
grafana/grafana latest 322e0a666176 2 weeks ago 233MB
rancher/rancher stable b821fa609f1a 3 weeks ago 674MB
prom/prometheus latest 358a0d2395fe 3 weeks ago 135MB
prom/pushgateway latest 35eb99337fe3 5 weeks ago 19.4MB
centos latest 470671670cac 3 months ago 237MB
prom/alertmanager latest 0881eb8f169f 4 months ago 52.1MB
prom/node-exporter latest e5a616e4b9cf 10 months ago 22.9MB
4.上傳Prometheus鏡像
docker tag prom/prometheus IP:Port/test/prometheus:v2.17.1
docker push IP:Port/test/prometheus:v2.17.1
5.上傳pushgateway鏡像
docker tag prom/pushgateway IP:Port/test/pushgateway:v1.2.0
docker push IP:Port/test/pushgateway:v1.2.0
6.上傳node-exporter鏡像
docker tag prom/node-exporter IP:Port/test/node-exporter:v0.18.1
docker push IP:Port/test/node-exporter:v0.18.1
7.上傳alertmanager鏡像
docker tag prom/alertmanager IP:Port/test/alertmanager:v0.20.0
docker push IP:Port/test/alertmanager:v0.20.0
8.rancher打標籤
docker tag rancher/rancher:stable rancher:v2.3.6