Access to DockerHub images from Amazon Elastic Beanstalk required when you need to deploy EBS environment based on Docker.
First on all you need to login to DockerHub (with account that has read & write permissions) using your’s machine terminal:
docker login
Than we need to copy content of ~/.docker/config.json to .dockerconfig (EBS require old-style file with cred):
cat ~/.docker/config.json > .dockerconfig
And finally, you need to remove auths block and file must be like this:
Ok, and now we need to create new S3 bucket in the same region as EBS will be deployed in.
..and upload dockerconfig to it:
Now we’ll create simple Dockerrun.aws.json for demo (note bucket name & file with key fields):
{ "AWSEBDockerrunVersion": "1", "Image": { "Name": "kagarlickij/myapp1" }, "Authentication": { "Bucket": "dockerhubkey", "Key": "dockerconfig" }, "Ports": [ { "ContainerPort": "80" } ] }
As you see, I’ve included to it my private image and DockerHub access key in S3 bucket.
So we can deploy new env to EBS now using Dockerrun.aws.json file.