Cannot authenticate to Docker in Elastic Beanstalk through S3


Following the instructions here to connect to a private docker hub container from Elastic Beanstalk, but it stubbornly refuses to work. It seems like when calling docker login in Docker 1.12 the resulting file has no email property, but it sounds like aws expects it so I create a file called dockercfg.json that looks like this:

The relevant piece of my file looks like this:

And I have the file uploaded at the root of the S3 bucket. Why do I still get errors that say Error: image c...6/w...t:23 not found. Check snapshot logs for details. I am sure the names are right and that this would work if it was a public repository. The full error is below. I am deploying from GitHub with Circle CI if it makes a difference, happy to provide any other information needed.

EDIT: Here’s the full Dockerrun file. Note that %BUILD_NUM% is just an int, I can verify that works.

EDIT: Also, I have verified that this works if I make this Docker Hub container public.


OK, let’s do this;

Looking at the same doc page,

With Docker version 1.6.2 and earlier, the docker login command creates the authentication file in ~/.dockercfg in the following format:

You already got this part correct I see. Please double check the cases below one by one;

1) Are you hosting the S3 bucket in the same region?

The Amazon S3 bucket must be hosted in the same region as the
environment that is using it. Elastic Beanstalk cannot download files
from an Amazon S3 bucket hosted in other regions.

2) Have you checked the required permissions?

Grant permissions for the s3:GetObject operation to the IAM role in
the instance profile. For details, see Managing Elastic Beanstalk
Instance Profiles

3) Have you got your S3 bucket info in your config file? (I think you got this too)

Include the Amazon S3 bucket information in the Authentication (v1) or
authentication (v2) parameter in your file.

Can’t see your permissions or your env region, so please double check those.
If that does not work, i’d upgrade to Docker 1.7+ if possible and use the corresponding ~/.docker/config.json style.

Leave a Reply