在我的docker-compose.yml中,我使用注册表: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容器,可以看到
感谢您的启迪...
如果我检查正在运行的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"
],发布于 2015-07-24 15:43:07
我需要用环境变量覆盖设置。不使用外部卷..
https://stackoverflow.com/questions/31501166
复制相似问题