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

Docker builds fail because requirements.txt is not available in the build context #113

Closed
fabacab opened this issue Mar 27, 2023 · 1 comment

Comments

@fabacab
Copy link
Contributor

fabacab commented Mar 27, 2023

When building the Wikmd Docker image, builds fail when attempting to install Python requirements because the requirements.txt file is not available to the Docker daemon (it's not in the docker folder):

**** install pip requirements ****
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
ERROR: Service 'wikmd' failed to build: The command '/bin/sh -c echo "**** install wikmd dependencies ****" &&   apt-get update -y &&   apt-get install -y python3-pip python3-dev pandoc git libxml2-dev libxslt1-dev &&   echo "**** install pip requirements ****" &&   cd /app/wikmd &&   pip3 install -r requirements.txt &&   echo "**** cleanup ****" &&   apt-get -y purge     python3-pip &&   apt-get -y autoremove &&   rm -rf     /tmp/*     /var/lib/apt/lists/*     /var/tmp/*     /root/.cache' returned a non-zero code: 1

This can be fixed by simply copying the requirements.txt file into the Docker build context:

cp requirements.txt docker

Not sure how you want to handle this for your development process, but I thought I'd report the issue.

@geirawsm
Copy link

I have seen that in other repositories the Docker files is in the root folder, possibly to avoid issues like this.

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

No branches or pull requests

3 participants