[SOLVED] - Docker registry with object storage


#1

Hello!
Can I use New Object Storage with docker registry? see https://docs.docker.com/registry/storage-drivers/s3/

I try with parameters:

REGISTRY_STORAGE: s3
REGISTRY_STORAGE_S3_ACCESSKEY:  "MY_ACCESSKEY"
REGISTRY_STORAGE_S3_SECRETKEY: "MY_SECRETKEY"
EGISTRY_STORAGE_S3_REGION: "nl-ams"
REGISTRY_STORAGE_S3_REGIONENDPOINT: "s3.nl-ams.scw.cloud"
REGISTRY_STORAGE_S3_BUCKET: "docker-registry"
REGISTRY_STORAGE_S3_V4AUTH: "true"
REGISTRY_STORAGE_S3_CHUNKSIZE: "5242880"
REGISTRY_STORAGE_S3_ROOTDIRECTORY: "/"
REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR: inmemory

but I received errors like {“storagedriver_s3”:“s3aws: InvalidURI: Couldn’t parse the specified URI.\n\tstatus code: 400, request id: txc083a72e1e3f43e6a37ee-005bbcc12c”}


#2
  REGISTRY_STORAGE: "s3"
  REGISTRY_STORAGE_S3_REGION: "nl-ams"
  REGISTRY_STORAGE_S3_ACCESSKEY: "ACCESS_KEY"
  REGISTRY_STORAGE_S3_SECRETKEY: "secret"
  REGISTRY_STORAGE_S3_BUCKET: "BUCKET"
  REGISTRY_STORAGE_S3_REGIONENDPOINT: "https://s3.nl-ams.scw.cloud"
  REGISTRY_STORAGE_S3_SECURE: "false"

You need to recompile the docker registry after upgrading aws sdk in the source code. Otherwise, you won’t be able to push.


#3

@sieben

Can you explain by steps what I should to do, please?
Have I to compile code from here: https://github.com/docker/distribution?
What’s means: “upgrading aws sdk in the source code”?


#4

Hello @mav,

There is a problem with aws-sdk-go dependency from https://github.com/docker/distribution.
In order to properly use Scaleway S3 Object Storage with Docker Registry, you will have to run through the following steps:

github.com/aws/aws-sdk-go v1.14.2
  • Pull updated dependencies
  • Build newer image of docker registry (you may use root project’s Dockerfile) using (inside root project dir):
docker build -t yourimage:yourtag .
  • Now you can use your docker registry’s image with updated AWS S3 dependencies and configure it using following environment variables (used in docker container for docker registry, you may also use configuration file, see https://docs.docker.com/registry/configuration/):
REGISTRY_STORAGE: "s3"
REGISTRY_STORAGE_S3_REGION: "nl-ams"
REGISTRY_STORAGE_S3_ACCESSKEY: "ACCESS_KEY_FROM_SCALEWAY"
REGISTRY_STORAGE_S3_SECRETKEY: "SECRET_KEY_FROM_SCALEWAY"
REGISTRY_STORAGE_S3_BUCKET: "BUCKET_NAME"
REGISTRY_STORAGE_S3_REGIONENDPOINT: "https://s3.nl-ams.scw.cloud"
REGISTRY_STORAGE_S3_SECURE: "false"

You have to change access, secret key and bucket name with your informations. All the other environment variables are valid the way I described above.
Then, everything shall work properly


#5

Hello @amasselot
Thank you very much! It’s works!