下载harbor 地址:https://github.com/goharbor/harbor/releases
修改hostname
vim harbor.yml
#hostname: 192.168.31.11
#port: 9090
#没有证书就直接注释443端口的配置
./install.sh #运行脚本进行安装
配置端口:
vim docker-compose.yml
# ports:
# - 9090:8080
登入页面测试 http://192.168.31.11:9090 默认 admin 用户的密码为 Harbor12345 ,可以在 harbor.yml 进行修改。
配置docker私有镜像仓库地址
http: server gave HTTP response to HTTPS client 1.检查docker启动参数
systemctl status docker #查看服务的service文件
● docker.service - Docker Application Container Engine
Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-04-25 00:11:46 CST; 12min ago
Docs: https://docs.docker.com
Main PID: 8592 (dockerd)
Tasks: 29
Memory: 53.3M
CGroup: /system.slice/docker.service
├─8592 /usr/bin/dockerd --selinux-enabled=false
└─8602 containerd --config /var/run/docker/containerd/containerd.toml --log-level info
cat /etc/systemd/system/docker.service
--insecure-registry=ip:9090 #通过字段设置docker默认请求http(不设置默认是https)
#任就报错
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://9cbpoldq.mirror.aliyuncs.com"],
"insecure-registries": ["192.168.31.11:9090"]
}
推镜像测试:
docker login -u admin -p Harbor12345 192.168.31.11:9090
docker push 192.168.31.11:9090/library/nginx:latest
返回页面查看项目情况
参考: https://www.cnblogs.com/huanchupkblog/p/10843800.html https://blog.csdn.net/dongyuan234/article/details/90298327 https://www.cnblogs.com/programmer-tlh/p/10996443.html
|