Docker无法运行AWS S3命令

2024-09-27 04:24:35 发布

您现在位置:Python中文网/ 问答频道 /正文

刚启动docker conda/miniconda3-centos7,但当进入容器并安装pip install awscli后,使用默认设置aws configure无法运行aws s3 ls。在

错误:

Unable to locate credentials. You can configure credentials by running "aws configure".

在docker运行的同一主机上-我可以运行上面的命令而没有问题。在


Tags: installpipdockerawss3configure错误conda
1条回答
网友
1楼 · 发布于 2024-09-27 04:24:35

我建议在运行期间与容器共享主机~/.aws/config文件上的当前凭据:

docker run -it -v ~/.aws:/root/.aws conda/miniconda3-centos7 /bin/bash

# export AWS_PROFILE=<MY_PROFILE_NAME> (Optionally export the required profile (if not default))
# pip install awscli
# aws s3 ls

相关问题 更多 >

    热门问题