在我的docker-compose.yml中,我正在使用注册表:2图像(版本) 因为我需要设置我自己的配置(使用S3存储),我试图用我的配置目录代替默认配置
/usr/share/docker-registry/config/config.yml#我在本地主机中的自己的注册表配置 /go/src/github.com/docker/distribution/cmd/registry/config.yml #infault in container
在我的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
什么可能是错的?如果我检查正在运行的注册表:v2容器,我可以看到
感谢任何启示......
如果我检查正在运行的注册表: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"
],
答案 0 :(得分:0)
我需要覆盖环境变量的设置..不使用外部卷..