Docker build image failed? Failed to compute cache key: "/app" not found: not found

Question:

Error :

failed to compute cache key: "/app" not found: not found

My Dockerfile:

FROM python:3.7-alpine

ENV PYTHONUNBUFFERED 1

COPY ./requirements.txt /requirements.txt
RUN pip install -r /requirements.txt

RUN mkdir /app
WORKDIR /app
COPY ./app /app

RUN adduser -D user
USER user

Error in COPY ./app app

Operating System: MacOS

Is someone faced this problem ?

project structure

Asked By: tarp20

||

Answers:

The APP folder does not exist in your project

You are trying to add an APP folder that does not exist into your docker container and it is complaining because there is no APP folder to add into the container

In the line

COPY ./APP /APP

The ./APP must reflect a folder that is in your project

Answered By: Tom

maybe IDE ‘s fault
check you’ve not added it to .dockerignore file.

Answered By: SwimmingFish

Another reason may be the files/folder you are trying to copy are not in the docker context. Make sure that if Dockerfile is present inside some subdirectory of parent directory e.g. parent-dir/child-dir/Dockerfile , run the docker build command from parent directory instead as below

docker build -f parent-dir/child-dir/Dockerfile -t image .
Answered By: Anshul Sood
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.