skip to Main Content

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


  1. please check your .dockerignore file as it is possible that venv.sh is matching some patterns there and therefore is not copied.

    Login or Signup to reply.
  2. There is some points you need to check:

    1. check your .dockerignore to see f you haven’t ignored the file or folder or everything (*).
    2. try running with docker build --no-cache.
    3. how are you running your docker build command? are you using vscode or any tool? make sure you cd to your project folder.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search