0

I am trying to upload a file to S3 using docker. I know how to use "aws" command, but not sure about the best way to use it within container.

# docker run --volume ~/.aws:/root/.aws -i --rm cgswong/aws:latest aws s3 cp mail.conf s3://mybucket/

I am getting an error:

The user-provided path mail.conf does not exist.

Another problem is that I use putty and I have to duplcate a new terminal session after using this command because this command does not return to normal prompt.

How do I use the docker container the same way I use aws command line tool?

1

1 Answer 1

3

The issue is most probably that your mail.conf is in your current folder and not inside the container. So you should change your command to

docker run -v ~/.aws:/root/.aws -v "$PWD:/host/$PWD" -w "/host/$PWD" -i --rm cgswong/aws:latest aws s3 cp mail.conf s3://mybucket/

This will make sure that your current directory also is mounted in container and you start in the same folder inside the container also

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.