使用registry配置dockerhub缓存
2024年11月4日约 84 字
version: '3.9'
services:
registry:
image: registry
container_name: registry
restart: always
volumes:
- "/etc/localtime:/etc/localtime"
- "./data:/var/lib/registry"
- "./config.yml:/etc/docker/registry/config.yml"
ports:
- '5000:5000'
config.yml
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
proxy:
remoteurl: https://registry-1.docker.io