The current directory of my project looks like this:
project
---- file1.dockerfile
---- scripts
-- venv.sh
-- task-name
-- run-script.sh
---- data
-- data1.json
Inside of file1.dockerfile
I have the following:
FROM python:3.10.10
WORKDIR /app
COPY ./scripts/venv.sh ./scripts/task-name/run-script.sh ./data/data1.json /app/
RUN /app/venv.sh && poetry shell
CMD ["bash", "/app/run-script.sh"]
When I run this I get the following error:
ERROR: failed to solve: failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/scripts/venv.sh" not found: not found
I tried to change the copy statement to COPY . .
and that seems to not solve anything. What am I doing wrong here?
Edit
Poetry is initialized inside of the first shell script.
2
Answers
please check your .dockerignore file as it is possible that venv.sh is matching some patterns there and therefore is not copied.
There is some points you need to check:
.dockerignore
to see f you haven’t ignored the file or folder or everything (*).docker build --no-cache
.cd
to yourproject
folder.