1 selinux相关
prepare base dir is set to /usr/local/harbor
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"write /proc/self/attr/keycreate: permission denied\"": unknown.
解决办法
把/etc/selinux下的config文件中的SELINUX=enforcing 改为 SELINUX=disabled
2 service
如果遇到Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? , 那应该是docker安装后没有设置为service,因此你需要在机器重启后再次启动docker。
解决办法
可以参考linux安装docker中的方法: sudo dockerd &
3 域名相关
如果遇到报错:ERROR:root:Please specify hostname, 那原因是启动harbor时没有修改harbor.yml里的内容。
解决办法
把配置文件中默认的hostname: reg.mydomain.com, 改为本地的ip。
比如: hostname:10.6.119.106
4 认证证书相关
如果遇到报错:ERROR:root:Error: The protocol is https but attribute ssl_cert is not set。 原因是harbor.yml中默认是配置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正确运行后, 信息如下:
✔ ----Harbor has been installed and started successfully.----