Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to upload into s3 bucket. #11

Open
pkhetan opened this issue Sep 26, 2018 · 1 comment
Open

Not able to upload into s3 bucket. #11

pkhetan opened this issue Sep 26, 2018 · 1 comment

Comments

@pkhetan
Copy link

pkhetan commented Sep 26, 2018

Hi,
I am trying to upload some files from my docker container to s3 bucket which is managed by rook. But while uploading it is not able to detect exact path for the object.

docker run --env AWS_ACCESS_KEY_ID=xyz --env AWS_SECRET_ACCESS_KEY=abc garland/aws-cli-docker aws --endpoint-url https://s3.company.com --no-verify-ssl s3 cp filename.txt s3://teamfelgen/test/

Result
The user-provided path filename.txt does not exist.

But I am in the same folder where this file is present.
Also I tried to put exact path from home directory like
~/piyush/filename.txt
/piyush/filename.txt

Note: Same command with aws cli is working as expected
aws --endpoint-url https://s3.company.com --no-verify-ssl s3 cp filename.txt s3://teamfelgen/test/

@ignaciojcano
Copy link

ignaciojcano commented Oct 7, 2018

@pkhetan it is trying to access the file inside the docker container when it gets executed, I'm assuming that the filename.txt is in your host computer. You would need to mount a volume in docker so that it is available.

You would use:
docker run --env AWS_ACCESS_KEY_ID=xyz --env AWS_SECRET_ACCESS_KEY=abc -v ~/piyush:/piyush garland/aws-cli-docker aws --endpoint-url https://s3.company.com --no-verify-ssl s3 cp /piyush/filename.txt s3://teamfelgen/test/

Notice the -v ~/piyush:/piyush, this is where we tell docker to mount the directory ~/piyush inside the docker container at /piyush. That is why, afterwards we tell the aws command to cp from /piyush/filename.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants