gpt4 book ai didi

amazon-web-services - 适用于awscli的Dockerfile

转载 作者:行者123 更新时间:2023-12-02 20:56:08 25 4
gpt4 key购买 nike

我正在尝试创建一个将安装awscli并运行命令以列出s3的docker文件。一旦执行了命令,容器本身就会退出。我使用此命令docker build --tag aws-cli:1.0 .来构建镜像。使用此命令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构建它后,我正在运行该docker文件
错误: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" ]

最佳答案

您在docker run命令中缺少镜像名称。应该是这样

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>

关于amazon-web-services - 适用于awscli的Dockerfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62920908/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com