Deploy an image on AWS Elastic Beanstalk from a private Docker replica

I am trying to extract a Docker image from my private repo and deploy it to AWS Elastic Beanstalk using Dockerrun.aws.json, packed in zip. Its contents

{ "AWSEBDockerrunVersion": "1", "Authentication": { "Bucket": "my-bucket", "Key": "docker/.dockercfg" }, "Image": { "Name": "namespace/repo:tag", "Update": "true" }, "Ports": [ { "ContainerPort": "8080" } ] } 

Where "my-bucket" is my name in bucket on s3, which uses the same place as my BS environment. The configuration set in the key is the result

 $ docker login 

called in docker2boot application terminal. He then copied to the docker folder in my-bucket. The image exists for sure. After that I download the .zip with the dockerrun file in EB and upon deployment I get

 Activity execution failed, because: WARNING: Invalid auth configuration file 

What am I missing? thanks in advance

+5
source share
1 answer

Docker updated the path to the configuration file from ~/.dockercfg to ~/.docker/config.json . They also took advantage of this opportunity to make changes to the configuration file format.

However, AWS is still expecting the old format used by ~/.dockercfg ( to see the file name in its documentation ):

 { "https://index.docker.io/v1/": { "auth": "__auth__", "email": "__email__" } } 

Which is incompatible with the new format used in ~/.docker/config.json :

 { "auths": { "https://index.docker.io/v1/": { "auth": "__auth__", "email": "__email__" } } } 

They are pretty similar. So if your version of Docker generates a new format, just separate the auths line and its corresponding curly brace, and you will go well.

+13
source

All Articles