@
molika 试试
# 国外机器执行
cat > docker-compose.yml << EOF
networks:
registry:
name: registry
services:
registry:
image: "registry:2.8.3"
container_name: registry
ports:
- "5000:5000"
networks:
- registry
restart: unless-stopped
volumes:
- "/etc/localtime:/etc/localtime"
- "./data:/var/lib/registry"
- "./config.yml:/etc/docker/registry/config.yml"
EOF
cat > config.yml << EOF
version: 0.1
log:
level: debug
formatter: json
storage:
filesystem:
rootdirectory: /var/lib/registry
delete:
enabled: true
cache:
blobdescriptor: inmemory
maintenance:
uploadpurging:
enabled: true
age: 168h
dryrun: false
interval: 1m
readonly:
enabled: false
http:
addr: 0.0.0.0:5000
health:
storagedriver:
enabled: true
interval: 10s
proxy:
remoteurl:
https://registry-1.docker.ioEOF
$ docker-compose up -d
# 国内机器执行
cat > /etc/docker/daemon.json << EOF
{
"insecure-registries": ["ip:5000"]
}
EOF
systemctl daemon-reload
systemctl restart docker
# 拉取镜像
docker pull ip:5000/library/nginx:latest