mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-01 22:54:20 +01:00
Add http_proxy configuration for Clair service
Clair needs Internet access to download vulnerabilities data. Fix issue https://github.com/vmware/harbor/issues/4272
This commit is contained in:
parent
cbcca015b0
commit
87c622141b
3
make/common/templates/clair/clair_env
Normal file
3
make/common/templates/clair/clair_env
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
http_proxy=$http_proxy
|
||||||
|
https_proxy=$https_proxy
|
||||||
|
no_proxy=$no_proxy
|
@ -47,6 +47,8 @@ services:
|
|||||||
options:
|
options:
|
||||||
syslog-address: "tcp://127.0.0.1:1514"
|
syslog-address: "tcp://127.0.0.1:1514"
|
||||||
tag: "clair"
|
tag: "clair"
|
||||||
|
env_file:
|
||||||
|
./common/config/clair/clair_env
|
||||||
networks:
|
networks:
|
||||||
harbor-clair:
|
harbor-clair:
|
||||||
external: false
|
external: false
|
||||||
|
@ -36,6 +36,12 @@ log_rotate_count = 50
|
|||||||
#are all valid.
|
#are all valid.
|
||||||
log_rotate_size = 200M
|
log_rotate_size = 200M
|
||||||
|
|
||||||
|
#Config http proxy for Clair, e.g. http://my.proxy.com:3128
|
||||||
|
#Clair doesn't need to connect to harbor ui container via http proxy.
|
||||||
|
http_proxy =
|
||||||
|
https_proxy =
|
||||||
|
no_proxy = 127.0.0.1,localhost,ui
|
||||||
|
|
||||||
#NOTES: The properties between BEGIN INITIAL PROPERTIES and END INITIAL PROPERTIES
|
#NOTES: The properties between BEGIN INITIAL PROPERTIES and END INITIAL PROPERTIES
|
||||||
#only take effect in the first boot, the subsequent changes of these properties
|
#only take effect in the first boot, the subsequent changes of these properties
|
||||||
#should be performed on web ui
|
#should be performed on web ui
|
||||||
|
@ -550,6 +550,15 @@ if args.clair_mode:
|
|||||||
username = clair_db_username,
|
username = clair_db_username,
|
||||||
host = clair_db_host,
|
host = clair_db_host,
|
||||||
port = clair_db_port)
|
port = clair_db_port)
|
||||||
|
# config http proxy for Clair
|
||||||
|
http_proxy = rcp.get("configuration", "http_proxy").strip()
|
||||||
|
https_proxy = rcp.get("configuration", "https_proxy").strip()
|
||||||
|
no_proxy = rcp.get("configuration", "no_proxy").strip()
|
||||||
|
clair_env = os.path.join(clair_config_dir, "clair_env")
|
||||||
|
render(os.path.join(clair_temp_dir, "clair_env"), clair_env,
|
||||||
|
http_proxy = http_proxy,
|
||||||
|
https_proxy = https_proxy,
|
||||||
|
no_proxy = no_proxy)
|
||||||
|
|
||||||
if args.ha_mode:
|
if args.ha_mode:
|
||||||
prepare_ha(rcp, args)
|
prepare_ha(rcp, args)
|
||||||
|
Loading…
Reference in New Issue
Block a user