user13879829
user13879829

Reputation:

Dockerfile for awscli

I am trying to create a docker file that will install awscli and run the command to list s3. Once the command is executed the container itself exits.I builrd the image with this command docker build --tag aws-cli:1.0 . I am running the this docker file after building it with this command docker run -it --rm -e AWS_DEFAULT_REGION='[your region]' -e AWS_ACCESS_KEY_ID='[your access ID]' -e AWS_SECRET_ACCESS_KEY='[your access key]' aws-cli Error: Unable to find image 'aws-cli:latest' locally docker: Error response from daemon: pull access denied for aws-cli, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

FROM python:2.7-alpine3.10
ENV AWS_DEFAULT_REGION='[your region]'
ENV AWS_ACCESS_KEY_ID='[your access key id]'
ENV AWS_SECRET_ACCESS_KEY='[your secret]'
RUN pip install awscli
CMD s3 ls
ENTRYPOINT [ "awscli" ]

Upvotes: 0

Views: 6913

Answers (2)

Dashrath Mundkar
Dashrath Mundkar

Reputation: 9212

You missed image name. Please provide image name while running docker run. like this

docker run -it --rm -e AWS_DEFAULT_REGION='[your region]' -e AWS_ACCESS_KEY_ID='[your access ID]' -e AWS_SECRET_ACCESS_KEY='[your access key]' aws-cli:1.0

Upvotes: 1

Malathi
Malathi

Reputation: 2195

You are missing the image name in the docker run command. It should be like this

docker run -it --rm -e AWS_DEFAULT_REGION='[your region]' -e AWS_ACCESS_KEY_ID='[your access ID]' -e AWS_SECRET_ACCESS_KEY='[your access key]' <docker image>

Upvotes: 1

Related Questions