安装 Docker
https://www.cnblogs.com/jhxxb/p/11410816.html
修改配置
vim /etc/docker/daemon.json { "insecure-registries" : ["myregistrydomain.com:5000", "0.0.0.0"] } # 重启服务 systemctl restart docker
安装 docker-compose
需要 epel 源:https://developer.aliyun.com/mirror/epel
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install docker-compose -y
安装 Harbor
下载 Harbor(harbor-offline-installer):https://github.com/goharbor/harbor/releases
# 解压 tar -zxf harbor-offline-installer-v2.0.2.tgz # 进入解压的目录,修改配置 cp harbor.yml.tmpl harbor.yml vim harbor.yml
修改配置(测试使用,不配置证书)
# 修改地址 hostname: 192.168.8.138 # 注释掉 https 访问 # https related config #https: # https port for harbor, default is 443 #port: 443 # The path of cert and key files for nginx #certificate: /your/certificate/path #private_key: /your/private/key/path
安装启动
./install.sh
默认为 80 端口,用户名:admin,密码:Harbor12345
停止、重启 Harbor(需要在安装目录下运行)
# Stop Harbor. docker-compose down -v # Restart Harbor docker-compose up -d
上传镜像
若上传失败请检查 /etc/docker/daemon.json 是否配置正确
docker tag cd645f5a4769 192.168.8.138/library/mysql:latest # admin Harbor12345 docker login 192.168.8.138 # 上传 docker push 192.168.8.138/library/mysql:latest