Docker安装harbor
Contents
配置
|
|
|
|
需要使用此镜像仓库的节点,信任CA证书即可
|
|
harbor.yml参考
hostname: harbor.mkl.io
http:
port: 8082
https:
port: 8446
certificate: /data/harbor/cert/mkl.io.crt
private_key: /data/harbor/cert/mkl.io.key
external_url: https://harbor.mkl.io
harbor_admin_password: Harbor12345
database:
password: root123
max_idle_conns: 100
max_open_conns: 900
data_volume: /data/harbor
运行
|
|
如果修改harbor.yml后,需重新配置
|
|
踩坑
报错:
yanyong@newmaster:~/harbor/harbor$ sudo docker push harbor.mkl.io/library/nginx:alpine
The push refers to repository [harbor.mkl.io/library/nginx]
6fda88393b8b: Pushing [==================================================>] 7.168kB
a770f8eba3cb: Preparing
318191938fd7: Pushing [==================================================>] 4.096kB
89f4d03665ce: Preparing
67bae81de3dc: Preparing
8d3ac3489996: Waiting
unauthorized: unauthorized to access repository: library/nginx, action: push: unauthorized to access repository: library/nginx, action: push
解决办法:
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
# Proxy headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header Forwarded $proxy_add_forwarded;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# Proxy timeouts
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;