Docker builds fail because `requirements.txt` is not available in the build context
fabacab opened this issue · 1 comments
fabacab commented
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 commented
I have seen that in other repositories the Docker files is in the root folder, possibly to avoid issues like this.