jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.39k stars 293 forks source link

Docker build stuck on cryptography dependency #501

Closed dennisN86 closed 3 years ago

dennisN86 commented 3 years ago

Hello,

the current Dockerfile is not properly executing a build anymore. It gets stuck while trying to build wheels for cryptography. I'm running Manjaro with the latest 5.11.0 Kernel. Thank you for having a look into this.

[dennis@moped buku]$ docker build -t bukuserver .

Sending build context to Docker daemon 5.615MB Step 1/8 : FROM python:alpine ---> 85987b1a8b9d Step 2/8 : MAINTAINER Ameya Shenoy "shenoy.ameya@gmail.com" ---> Using cache ---> 527c082aba0e Step 3/8 : ENV BUKUSERVER_PORT=5001 ---> Using cache ---> a83090fcb694 Step 4/8 : COPY . /buku ---> Using cache ---> fe5857e60498 Step 5/8 : RUN set -ex && apk add --no-cache --virtual .build-deps gcc openssl-dev musl-dev libffi-dev && pip install -U --no-cache-dir pip gunicorn /buku[server] && apk del .build-deps && rm -rf /buku ---> Running in 7adf6954c055

rachmadaniHaryono commented 3 years ago

it seems related to https://github.com/docker/compose/issues/8105

0xFEEDCAFE commented 3 years ago

Cryptography built with rust seems to not be necessary for building the container. A workaround is to modify the docker file as mentioned in the debug assistance section. A simple adding of following line to Dockerfile should fix it:

ARG CRYPTOGRAPHY_DONT_BUILD_RUST=1

Then try to build the docker image again.

rachmadaniHaryono commented 3 years ago

pr created based on comment above and other pr i mentioned. if anybody can test it and it work, pr should be accepted

dennisN86 commented 3 years ago

The change above is sadly throwing the same error.

rachmadaniHaryono commented 3 years ago

can you try it once again?

there is actually flag to set env var direct from command line

https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file

so you may want to try that to if recent commit failed

dennisN86 commented 3 years ago

I check out the latest commit and my build went though as well. Thanks for fixing the issue!

jarun commented 3 years ago

Closed at #502.