【发布时间】:2021-10-05 01:00:58
【问题描述】:
我正在尝试从 Dockerfile 创建 Docker 映像,在执行此操作时,我在 COPY 步骤中遇到以下错误:
failed to compute cache key: not found: not found 使用相对路径时,以及
error from sender: Create file .......\Temp\empty-dir347165903\C:: The filename, directory name, or volume label syntax is incorrect 使用绝对值时
我正在尝试的确切命令是 COPY main.py ./ 重要说明是没有任何 .dockerignore 文件,没有设置容器,main.py 和 Dockerfile 都位于同一目录中
这是 Dockerfile 本身的样子:
From public.ecr.aws/lambda/python:3.8
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY main.py ./
RUN mkdir chrome
RUN curl -SL (chromedriver link here) > chromedriver.zip
RUN unzip chromedriver.zip -d chrome/
RUN rm chromedriver.zip
【问题讨论】:
-
您正在运行的实际
docker build命令是什么?该 Dockerfile 是否应该有一个默认的CMD来运行?你应该设置一个WORKDIR而不是图像的根目录吗? -
我运行的命令是 docker build - CMD实际上是在Dockerfile中,我只是忘了包含它,那是CMD [“main.main”]。并且图像的根目录应该可以解决问题,所以我不打算更改它
标签: python docker aws-lambda dockerfile