小编ric*_*chy的帖子

Docker 从 public.ecr.aws 拉取导致“403 Forbidden”错误

我尝试使用 Amazon ECR Public 中的 public.ecr.aws/lambda/python:3.8 映像作为 Dockerfile 中的基础映像,在我的 Mac M1 计算机上构建 Docker 映像。但是,我在拉取镜像的过程中遇到了以下错误:

ERROR: failed to solve: public.ecr.aws/lambda/python:3.8: pulling from host public.ecr.aws failed with status code: 403 Forbidden

这是我的 Dockerfile 的相关部分:

FROM public.ecr.aws/lambda/python:3.8

COPY requirements.txt  .
RUN  pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"

COPY app.py ${LAMBDA_TASK_ROOT}

CMD [ "app.handler" ]
Run Code Online (Sandbox Code Playgroud)

我尝试了诸如运行 build 或 buildx build --platform linux/amd64 命令之类的所有操作,但没有运气。

我直接从 python:slim 尝试,得到了结果,但我想使用公共 ecr。

amazon-web-services aws-lambda amazon-ecr

7
推荐指数
1
解决办法
5644
查看次数