Access to DockerHub images from Amazon Elastic Beanstalk

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

 

Screen Shot 2015-12-22 at 17.20.04

Than we need to copy content of ~/.docker/config.json to .dockerconfig (EBS require old-style file with cred):

cat ~/.docker/config.json > .dockerconfig

Screen Shot 2015-12-22 at 17.23.43

 

And finally, you need to remove auths block and file must be like this:

Screen Shot 2015-12-24 at 20.48.43

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:

Screen Shot 2015-12-22 at 17.29.31

 

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.

Pin It

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.