Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile Image Creation Error : COPY failed: file not found in build context or excluded by .dockerignore: stat organize: file does not exist #409

Open
nodecentral opened this issue Aug 23, 2024 · 1 comment
Labels

Comments

@nodecentral
Copy link

nodecentral commented Aug 23, 2024

Describe the bug

COPY function of COPY ./organize ./organize always fails and returns an error ?

No matter what location I choose as the source for the Organize folder I’m unable to complete the creation of a local image of Organize from the Dockerfile provided in the respository ?

Here’s what I have done - I have downloaded the github repo, and placed the organize-main folder into my local Container folder structure, and then via the command line I go into the run the docker build command - but when running the build - it fails with the Error COPY failed: file not found in build context or excluded by .dockerignore: stat organize: file does not exist

I’ve tried to fix it by updating the Dockerfile directly with other source locations e.g. COPY . /share/Container/organize/organize-main/organize ./organize based on where I’m running the docker build -t organize . command from, even trying ADD rather than COPY too, but none seem to work ??

Any ideas ?.

Screenshots
Here is output from the CLI after multiple attempts - as previous attempts failed progress is cached, which makes it easier to post this content

[/share/Container/organize/organize-main] # docker build -t organize .
Sending build context to Docker daemon  151.6kB
Step 1/16 : FROM python:3.11-slim as base
 ---> 10f461201cdb
Step 2/16 : ENV PIP_DISABLE_PIP_VERSION_CHECK=1     PYTHONUNBUFFERED=1     VIRTUAL_ENV="/venv"
 ---> Using cache
 ---> 0129a90581ff
Step 3/16 : ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
 ---> Using cache
 ---> b8c6991957b9
Step 4/16 : WORKDIR /app
 ---> Using cache
 ---> b1ec777ec6cb
Step 5/16 : FROM base as pydeps
 ---> b1ec777ec6cb
Step 6/16 : RUN pip install "poetry==1.7.1" &&     python -m venv ${VIRTUAL_ENV}
 ---> Using cache
 ---> 5fbd1ad8ef05
Step 7/16 : COPY pyproject.toml poetry.lock ./
 ---> Using cache
 ---> 055de8d06707
Step 8/16 : RUN poetry install --only=main --no-interaction
 ---> Using cache
 ---> 2a22fd44d4ae
Step 9/16 : FROM base as final
 ---> b1ec777ec6cb
Step 10/16 : RUN apt update &&     apt install -y exiftool poppler-utils &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 5dac43d932ef
Step 11/16 : ENV ORGANIZE_CONFIG=/config/config.yml     ORGANIZE_EXIFTOOL_PATH=exiftool
 ---> Using cache
 ---> 59e0ae2a511f
Step 12/16 : RUN mkdir /config && mkdir /data
 ---> Using cache
 ---> 66166bee4663
Step 13/16 : COPY --from=pydeps ${VIRTUAL_ENV} ${VIRTUAL_ENV}
 ---> Using cache
 ---> a9a03871fbd6
Step 14/16 : COPY ./organize ./organize
COPY failed: file not found in build context or excluded by .dockerignore: stat organize: file does not exist
[/share/Container/organize/organize-main] #

Environment (please complete the following information):

  • OS: = LINUX QNAP
  • Output of organize --version: = Latest

Your config file

not go to this stage yet, unable to create local image
@nodecentral
Copy link
Author

nodecentral commented Aug 25, 2024

Think I have fixed this by changing the Dockerfile from COPY ./organize ./organize to COPY . ./Organize

Please can someone confirm ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant