简体   繁体   中英

Dockerfile showing error "failed to compute cache key: "/Pipfile.lock" not found"

Dockerfile:

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

Error Displayed:

=> 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

Tried clearing pipfile cache but now it gave cancelled in the 1st run command as well

When you build your docker image

at step

COPY Pipfile Pipfile.lock /sphinxtechnicalwriting/

files Pipfile and Pipfile.lock will be copied from same folder where you launch docker build... (or other command you launch to build) to the docker image.

Error says that there are no such files at source folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM