【发布时间】:2023-02-12 17:06:55
【问题描述】:
文件:
FROM python:3.8-slim-buster
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y --no-install-recommends make && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir pipenv
WORKDIR /sphinxtechnicalwriting
COPY Pipfile Pipfile.lock /sphinxtechnicalwriting/
RUN pipenv install --system --deploy
错误显示:
=> CANCELED [2/5] RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends make && apt-get clean && 0.6s
=> CACHED [3/5] WORKDIR /sphinxtechnicalwriting 0.0s
=> ERROR [4/5] COPY Pipfile Pipfile.lock /sphinxtechnicalwriting/ 0.0s
------
> [4/5] COPY Pipfile Pipfile.lock /sphinxtechnicalwriting/:
------
failed to compute cache key: "/Pipfile.lock" not found: not found
尝试清除 pipfile 缓存,但现在它在第一次运行命令中也取消了
【问题讨论】:
-
Pipfile.lock在您的主机系统上是否与Pipfile(可能还有Dockerfile)在同一目录中? -
是的,通过单独安装 pipenv lock 解决了这个错误。但其他错误仍未解决
标签: docker dockerfile pipenv