amazon s3 - Docker registry:2.0 overriding configuration options -
has tried using environment variables override configuration options in registry, if have use s3 bucket storage example. read doc , says (https://docs.docker.com/registry/configuration/):
overriding configuration options environment variables may used override configuration parameters other version. override configuration option, create environment variable named registry_variable_ variable name of configuration option. e.g registry_storage_filesystem_rootdirectory=/tmp/registry/test set storage root directory /tmp/registry/test
so tried command, not seem have effect when start registry:
docker run -it -v /var/log/docker-registry:/var/log -p 5000:5000 \ -e registry_storage_s3_accesskey=****************** \ -e registry_storage_s3_secretkey=****************** \ -e registry_storage_s3_bucket=itmcc-docker-registry-backend \ -e registry_storage_s3_region=us-east-1 \ registry:2.0
in logs see regular output if not take env variables account , try connect s3:
info[0000] endpoint local-8082 disabled, skipping environment=development instance.id=025c9fcd-2ec1-4d5f-82ec-d3246d54cdb5 service=registry version=v2.0.0 info[0000] endpoint local-8083 disabled, skipping environment=development instance.id=025c9fcd-2ec1-4d5f-82ec-d3246d54cdb5 service=registry version=v2.0.0 info[0000] using inmemory layerinfo cache environment=development instance.id=025c9fcd-2ec1-4d5f-82ec-d3246d54cdb5 service=registry version=v2.0.0 info[0000] listening on :5000 environment=development instance.id=025c9fcd-2ec1-4d5f-82ec-d3246d54cdb5 service=registry version=v2.0.0 info[0000] starting upload purge in 42m0s environment=development instance.id=025c9fcd-2ec1-4d5f-82ec-d3246d54cdb5 service=registry version=v2.0.0 info[0000] debug server listening localhost:5001
ps: if use iam role ec2, seems redundant pass in access , secret key docker registry container, can docker utilize iam role yet, has tried that?
edit: after run container , exec command see output of env:
root@0a349294f792:/go/src/github.com/docker/distribution# env registry_storage_s3_secretkey=************************* distribution_dir=/go/src/github.com/docker/distribution golang_version=1.4.2 hostname=0a349294f792 registry_storage_s3_bucket=itmcc-docker-registry-backend path=/go/bin:/usr/src/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin pwd=/go/src/github.com/docker/distribution registry_storage_s3_region=us-east-1 shlvl=1 home=/root gopath=/go/src/github.com/docker/distribution/godeps/_workspace:/go registry_storage_s3_accesskey=************************* _=/usr/bin/env root@0a349294f792:/go/src/github.com/docker/distribution#
the complete command works me docker run
command is:
docker run -d -p 5000:5000 \ -e "registry_storage=s3" \ -e "registry_storage_s3_region=us-east-1"\ -e "registry_storage_s3_bucket=******"\ -e "registry_storage_s3_accesskey=******"\ -e "registry_storage_s3_secretkey=******"\ registry:2
note addition of registry_storage=s3
environment variable.
they hint @ in registry docs:
note: if environment variable changes map value string, such replacing storage driver type registry_storage=filesystem, sub-fields erased. such, specifying storage type in environment remove parameters related old storage configuration.
Comments
Post a Comment