Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple storage drivers panic in private registry

I'm trying to deploy an S3-backed private docker registry and I'm getting an error when I try to start the registry container. My docker-compose.yml looks like this:

registry:
  restart: always
  image: registry:2
  ports:
    - 5000:5000
  environment:
    REGISTRY_STORAGE_S3_ACCESSKEY: myKey
    REGISTRY_STORAGE_S3_SECRETKEY: mySecret
    REGISTRY_STORAGE_S3_BUCKET: docker.registry.bucket
    REGISTRY_STORAGE_S3_ROOTDIRECTORY: registry/data
  volumes:
    - /home/docker/certs:/certs

And when I try to run sudo docker-compose up -d I get this error message:

registry_1 | panic: multiple storage drivers specified in configuration or environment: s3, filesystem

It seems like I'm missing something in my environment to explicitly choose s3 but it's not clear from the docs how to do this.

like image 707
sak Avatar asked Nov 10 '15 08:11

sak


People also ask

Which option S configures the docker Deamon to connect to a registry?

http. The http option details the configuration for the HTTP server that hosts the registry. The address for which the server should accept connections.

Can you please name some docker storage drivers?

Though Docker considers all of the storage drivers mentioned here to be stable, some are newer and are still under active development. In general, overlay2 , aufs , and devicemapper are the choices with the highest stability.

Which docker command is used to determine the current storage driver configured?

To see the storage driver being used, issue the docker info command.


2 Answers

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.

like image 195
user1753519 Avatar answered Oct 05 '22 12:10

user1753519


There is REGISTRY_STORAGE environment variable missing. Need to be added to the "env" block.

like image 44
Vasily Avatar answered Oct 05 '22 12:10

Vasily