docker-镜像仓库搭建

在node3 node4上 上传harbor-offline-installer-v1.3.0.tgz
[[email protected] ~]# tar xf harbor-offline-installer-v1.3.0.tgz
[[email protected] ~]# tar xf harbor-offline-installer-v1.3.0.tgz

[[email protected] harbor]# pwd
/root/harbor

[[email protected] harbor]# vim harbor.cfg
hostname = 10.0.0.17
harbor_admin_password = 123456

[[email protected] harbor]# vim harbor.cfg
hostname = 10.0.0.18
harbor_admin_password = 123456

[[email protected] harbor]# sh install.sh
[[email protected] harbor]# sh install.sh
docker-镜像仓库搭建
[[email protected] harbor]# docker tag 6858809bf669 10.0.0.18/library/busybox:v1 上传镜像
[[email protected] harbor]# docker login 10.0.0.18 —登录
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

如果遇到以下报错
[[email protected] harbor]# docker login 10.0.0.18
ername: admin
Password:
Error response from daemon: Get https://10.0.0.18/v2/: dial tcp 10.0.0.18:443: connect: connection refuse

添加
[[email protected] harbor]# vim /etc/docker/daemon.json
“insecure-registries”: [“10.0.0.18”]

systemctl daemon-reload
systemctl restart docker
docker-compose up –d —在软件目录才能执行的命令

[[email protected] harbor]# docker push 10.0.0.18/library/busybox:v1
The push refers to repository [10.0.0.18/library/busybox]
be8b8b42328a: Pushed
v1: digest: sha256:2ca5e69e244d2da7368f7088ea3ad0653c3ce7aaccd0b8823d11b0d5de956002 size: 527

docker-镜像仓库搭建
[[email protected] harbor]# docker rmi —删除本地镜像

复制管理功能
点击项目里的复制。
docker-镜像仓库搭建
docker-镜像仓库搭建
推送成功