Build Docker image with AWS CLI tools installed

Using Docker image with AWS CLI tools installed

docker@boot2docker:~$ docker pull sdevarapalli/aws-cli
Using default tag: latest
latest: Pulling from sdevarapalli/aws-cli

3d8673bd162a: Pull complete
da63d6cdd79e: Pull complete
13e98e81fd0b: Pull complete
6722a77327b6: Pull complete
6d930c14ca40: Pull complete
b3c4f1214f20: Pull complete
Digest: sha256:9e50b198a8909febe940b7fd702c7f92d9ff353e941140be06c7a9b9d38fd67a
Status: Downloaded newer image for sdevarapalli/aws-cli:latest
docker@boot2docker:~$
docker@boot2docker:~$
docker@boot2docker:~$
docker@boot2docker:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sdevarapalli/aws-cli latest ec15aa2e51a2 37 minutes ago 699.6 MB
docker@boot2docker:~$
docker@boot2docker:~$
docker@boot2docker:~$
docker@boot2docker:~$docker run -i -t -h aws-cli \
--env AWS_ACCESS_KEY_ID=REPLACE_WITH_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY=REPLACE_WITH_SECRET_ACCESS_KEY \
--env AWS_DEFAULT_REGION=us-east-1 \
sdevarapalli/aws-cli /bin/bash
[root@aws-cli /]# aws iam list-users
{
"Users": [
{
"UserName": "xyz",
"PasswordLastUsed": "1900-01-01T01:01:01Z",
"CreateDate": "1900-01-01T01:01:01Z",
"UserId": "1111111",
"Path": "/",
"Arn": "arn:aws:iam::111111:user/xyz"
}
]
}
[root@aws-cli /]#

Steps to build and publish image

Build Image

$ git clone https://github.com/sdevarapalli1/aws-cli.git
# cd aws-cli
$ docker build -t sdevarapalli/aws-cli:latest -t sdevarapalli/aws-cli:0.2 .
......
......
......
Successfully built ec15aa2e51a2
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sdevarapalli/aws-cli latest ec15aa2e51a2 2 minutes ago 699.6 MB

Log in and Publish Image to Docker Hub

docker@boot2docker:~$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (sdevarapalli):
Password:
Login Succeeded


docker@boot2docker:~$ docker push sdevarapalli/aws-cli:latest
The push refers to a repository [docker.io/sdevarapalli/aws-cli]
6044067d6476: Pushed
4d04059a14fc: Pushed
2c54e224dec4: Pushed
f6ff5fe8484d: Pushed
e1ada7271bd0: Pushed
f59b7e59ceaa: Pushed
latest: digest: sha256:9e50b198a8909febe940b7fd702c7f92d9ff353e941140be06c7a9b9d38fd67a size: 1583
docker@boot2docker:~$
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s