在我的 docker-compose.yml 中,我使用的是 registry:2 映像(版本),因为我需要设置自己的配置(用于使用 S3 存储),我试图用我的配置目录代替默认目录
/usr/share/docker-registry/config/config.yml # 我自己在本地主机中的注册表配置 /go/src/github.com/docker/distribution/cmd/registry/config.yml # 默认在容器中
在我的 docker-compose.yml 中,我写了
backend:
image: registry:2
ports:
- 127.0.0.1:5000:5000
links:
- cache
volumes:
- /usr/share/docker-registry/config:/go/src/github.com/docker/distribution/cmd/registry
..
但是当我编写它时,我的配置设置从未被考虑在内......它总是使用容器 cmd/registry/config.yml 中的默认设置
有什么问题?
如果我检查正在运行的 registry:v2 container ,我可以看到
感谢您的任何启发...
如果我检查正在运行的 registry:v2 容器,配置很奇怪(有 S3 信息,但没有卷,并且 CMD 正在执行标准 config.yml 文件...)
"Config": {
"Hostname": "5337012111a5",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": {
"5000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"SETTINGS_FLAVOR=local",
"REGISTRY_STORAGE_S3_SECURE=True",
"REGISTRY_STORAGE_S3_ENCRYPT=True",
"REGISTRY_STORAGE_S3_ROOTDIRECTORY=/s3/object/name/prefix",
"CACHE_REDIS_PORT=6379",
"REGISTRY_STORAGE_S3_V4AUTH=True",
"REGISTRY_STORAGE_S3_CHUNKSIZE=5242880",
"REGISTRY_STORAGE_S3_SECRETKEY=yyyyyyyyyyyyyyyyyyyyyyyy”,
"CACHE_LRU_REDIS_PORT=6379",
"SEARCH_BACKEND=sqlalchemy",
"CACHE_REDIS_HOST=cache",
"REGISTRY_STORAGE_S3_ACCESSKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
"CACHE_LRU_REDIS_HOST=cache",
"REGISTRY_STORAGE_S3_REGION=eu-central-1",
"REGISTRY_STORAGE_S3_BUCKET=harbor.dufour16.net",
"PATH=/go/bin:/usr/src/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOLANG_VERSION=1.4.2",
"GOPATH=/go/src/github.com/docker/distribution/Godeps/_workspace:/go",
"DISTRIBUTION_DIR=/go/src/github.com/docker/distribution"
],
"Cmd": [
"cmd/registry/config.yml"
],
"Image": "registry:2",
"Volumes": null,
"VolumeDriver": "",
"WorkingDir": "/go/src/github.com/docker/distribution",
"Entrypoint": [
"registry"
],