一、安装docker-compose
1-1、
#安装方式一 curl -SL https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose #安装方式二 #打开https://github.com/docker/compose/tags 查找对应的自己需要的版本下载,下载完后 #拷贝到对应的目录里面 cp -fr docker-compose-linux-x86_64 /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
1-2、查看docker-compose是否安装成功
[root@docker-1 harbor]# docker-compose version Docker Compose version v2.11.2
注:出现先上面的版本号信息说明安装成功
二、Harbor安装
2-1、下载连接地址:
https://github.com/goharbor/harbor/releases/download/v2.4.2/harbor-offline-installer-v2.4.2.tgz
注:这里下载的是harbor v2.4.2版本。如果选择其它版本访问 https://github.com/goharbor/harbor/releases
2-2、安装
#解压 tar zxf harbor-offline-installer-v2.4.2.tgz #切换目录 cd harbor/ #查看目录里面是否有harbor.yml这个文件无需修改,如果是harbor.yml.tmpl 文件需要重命名为harbor.yml cp -fr harbor.yml.tmpl harbor.yml
2-3、修改harbor.yml 配置文件
注:关于修改harbor 配置文件根据接头把hostname, http-port:80端口, https 这三项修改即可。
2-4、安装Harbor
sh install.sh
注:出现 ✔ ----Harbor has been installed and started successfully.---- 语句说明安装成功
2-5、查看安装Harbor容器运行
注:0.0.0.0:8080->8080/tcp, :::8080->8080/tcp 代表访问端口和容器端口
2-6、访问
本机IP/域名:查看的端口号。如果是80端口直接访问IP/域名即可
Harbor用户/密码: 用户默认登录账户admin 默认密码是Harbor12345
2-7、利用http 上传镜像报以下错误提示和解决
#错误提示 docker push 192.168.3.110:8080/webserver/nginx:v1 The push refers to repository [192.168.3.110:8080/webserver/nginx] Get https://192.168.3.110:8080/v1/: http: server gave HTTP response to HTTPS client #解决方法 { "exec-opts": ["native.cgroupdriver=systemd"], "registry-mirrors": ["https://registry.docker-cn.com", "https://hub-mirror.c.163.com"], "insecure-registries": ["192.168.3.110:8080"], #添加这行内容,IP地址和端口修改成自己的 } #重启docker服务 systemctl restart docker
注:docker服务重启后,相关harbor容器有可能关闭,需要重启
cd /harbor/harbor/ #重启命令 root@docker-1 harbor]# docker-compose restart [+] Running 9/9 ⠿ Container harbor-log Started 11.2s ⠿ Container registryctl Started 11.6s ⠿ Container harbor-portal Started 3.2s ⠿ Container registry Started 2.9s ⠿ Container harbor-db Started 11.7s ⠿ Container redis Started 3.3s ⠿ Container harbor-core Started 1.1s ⠿ Container nginx Started 2.2s ⠿ Container harbor-jobservice Started
标签:compose,Container,Harbor,离线,Started,harbor,https,docker,安装 From: https://www.cnblogs.com/albert919/p/16767457.html