Multiple storage drivers panic in private registry

I was trying to override the storage configuration by using ENV vars. This workaround did the job (in json format):

{
    "REGISTRY_STORAGE": "s3",
    "REGISTRY_STORAGE_S3_REGION": <REGION>,
    "REGISTRY_STORAGE_S3_BUCKET": <BUCKET_NAME>,
    "REGISTRY_STORAGE_S3_ROOTDIRECTORY": <ROOT_PATH>,
    "REGISTRY_STORAGE_S3_ACCESSKEY": <KEY>,
    "REGISTRY_STORAGE_S3_SECRETKEY": <SECRET>
}

It looks like by defining REGISTRY_STORAGE we override the one in config.yml.


You're getting this error because the registry:2 image comes with a default config file /etc/docker/registry/config.yml which uses filesystem storage.

By adding S3 storage using environment variables there are multiple storage drivers, which I guess isn't supported.

I don't know of any way to remove configuration options with environment variables, so I think you'll probably need to create a config file and mount it as a volume (http://docs.docker.com/registry/configuration/#overriding-the-entire-configuration-file)