0

Not sure if more details are required, but I'm running a docker container to execute boto3 commands and I have already been using them outside of the container. So upon mapping them to the container as such:

docker run --name store -v $HOME/.aws:/root/.aws my-store python ./mystore/manage.py test store/ --pattern="tests_*.py"

you would think it will just work but it threw:

botocore.exceptions.NoRegionError: You must specify a region.

Why is it not using ~/.aws/config ?

momo668
  • 199
  • 3
  • 8
  • Why not just pass env vars instead? Will make it much simpler. Boto looks for the config first before searching for env vars. Documentation is [here](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentials). So to use env vars with boto, will need to set these three env vars `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION` – Jeff Gruenbaum May 25 '23 at 19:44
  • I just find the procedure of having to copy/paste to use more time than mapping the same thing for everything I work on. But yours might just be more secure. – momo668 May 25 '23 at 19:47

1 Answers1

0

Ok I figured out why 2 minutes later because it was answered: Source

Basically, it is being picky so I did:

docker run --name store -v $HOME/.aws:root/.aws:ro my-store python ./mystore/manage.py test store/ --pattern="tests_*.py"

need to add read-only.

momo668
  • 199
  • 3
  • 8