Merge pull request #5273 from wy65701436/conf-reg-redis

Update docker registry cache from inmemory to redis.
This commit is contained in:
Daniel Jiang 2018-07-09 20:03:25 +08:00 committed by GitHub
commit 5357b7ea76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View File

@ -5,13 +5,16 @@ log:
service: registry
storage:
cache:
layerinfo: inmemory
layerinfo: redis
$storage_provider_info
maintenance:
uploadpurging:
enabled: false
delete:
enabled: true
redis:
addr: $redis_url
db: 1
http:
addr: :5000
secret: placeholder

View File

@ -14,15 +14,7 @@ storage:
enabled: true
redis:
addr: $redis_url
db: 0
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
db: 1
http:
addr: :5000
secret: placeholder

View File

@ -415,7 +415,8 @@ render(os.path.join(templates_dir, "ui", "env"),
adminserver_url = adminserver_url
)
registry_config_file = "config_ha.yml" if args.ha_mode else "config.yml"
registry_config_file_ha = "config_ha.yml"
registry_config_file = "config.yml"
if storage_provider_name == "filesystem":
if not storage_provider_config:
storage_provider_config = "rootdirectory: /storage"
@ -426,6 +427,13 @@ storage_provider_conf_list = [storage_provider_name + ':']
for c in storage_provider_config.split(","):
storage_provider_conf_list.append(c.strip())
storage_provider_info = ('\n' + ' ' * 4).join(storage_provider_conf_list)
render(os.path.join(templates_dir, "registry", registry_config_file_ha),
registry_conf,
storage_provider_info=storage_provider_info,
public_url=public_url,
ui_url=ui_url,
redis_url=redis_url)
render(os.path.join(templates_dir, "registry", registry_config_file),
registry_conf,
storage_provider_info=storage_provider_info,