依赖安装
安装harbor
cd /home
tar xf harbor-offline-installer-dev-arm.tgz
cd harbor
复制生成配置文件并修改
cp harbor.yml.tmpl harbor.yml
修改以下字段 ,其中http和https选其中一个,https需要证书
hostname: harbor01.io
port: 80
harbor_admin_password: Harbor12345
data_volume: /data
location: /var/log/harbor
chmod 777 -R /home/harbor/common/
命令脚本部署启动harbor
./install.sh
Harbor的启动与停止
Restart Docker Engine.
systemctl restart docker
Stop Harbor.
docker-compose down -v
Restart Harbor.
docker-compose up -d
可能出现的问题
问题1:OCI runtime create failed
Error response from daemon: failed to create shim task: OCI runtime create failed: container_linux.go:318: starting container process caused "permission denied": unknown
卸载podman 解决
yum remove podman
问题2: ✘ Network harbor_harbor
failed to create network harbor_harbor: Error response from daemon: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER -i br-2fe50e5ea4a8 -j RETURN: iptables: No chain/target/match by that name.
这个是因为docker网络模块没启动,重启机器解决
Reboot
问题3:jobservice IPv4 forwarding is disabled. Networking will not work.
jobservice IPv4 forwarding is disabled. Networking will not work. 0.0s
! proxy IPv4 forwarding is disabled. Networking will not work.
通过修改配置文件解决:
echo "net.ipv4.ip_forward=1" >>/usr/lib/sysctl.d/00-system.conf
问题4:nginx起不来,报如下错误
docker logs -f --tail 100 168fd4349f73
2023/05/04 09:07:37 [emerg] 1#0: open() "/etc/nginx/nginx.conf" failed (13: Permission denied)
nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (13: Permission denied)
2023/05/04 09:07:38 [emerg] 1#0: open() "/etc/nginx/nginx.conf" failed (13: Permission denied)
(1)禁用SELinux
setenforce 0 这是临时禁用
如果要永久关闭,可以
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
chmod 777 -R /home/harbor/common/
重启机器即可