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
2
Answers
When you build your docker image
at step
files
Pipfile
andPipfile.lock
will be copied from same folder where you launchdocker build ...
(or other command you launch to build) to the docker image.Error says that there are no such files at source folder.
I experienced the same bug today, the fix was to remove
Pipfile.lock
from my.dockerignore
file, that’s why Docker could not find the Pipfile.