metaplex-foundation / metaplex

A directory of what the Metaplex Foundation works on!
https://metaplex.com
Apache License 2.0
3.32k stars 6.25k forks source link

failed docker build #1183

Closed markmacau closed 2 years ago

markmacau commented 2 years ago

Describe the bug Docker build using Dockerfile failed. The problem seems to happen at node-canvas installation due to lack of python.

#13 365.9 [5/5] Building fresh packages...
#13 374.4 error /app/node_modules/canvas: Command failed.
#13 374.4 Exit code: 1
#13 374.4 Command: node-pre-gyp install --fallback-to-build
#13 374.4 Arguments: 
#13 374.4 Directory: /app/node_modules/canvas
#13 374.4 Output:
#13 374.4 node-pre-gyp info it worked if it ends with ok
#13 374.4 node-pre-gyp info using node-pre-gyp@1.0.5
#13 374.4 node-pre-gyp info using node@14.17.3 | linux | x64
#13 374.4 node-pre-gyp info check checked for "/app/node_modules/canvas/build/Release/canvas.node" (not found)
#13 374.4 node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-linux-musl-x64.tar.gz
#13 374.4 node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-linux-musl-x64.tar.gz 
#13 374.4 node-pre-gyp WARN Pre-built binaries not installable for canvas@2.8.0 and node@14.17.3 (node-v83 ABI, musl) (falling back to source compile with node-gyp) 
#13 374.4 node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-linux-musl-x64.tar.gz 
#13 374.4 gyp info it worked if it ends with ok
#13 374.4 gyp info using node-gyp@5.1.1
#13 374.4 gyp info using node@14.17.3 | linux | x64
#13 374.4 gyp info ok 
#13 374.4 gyp info it worked if it ends with ok
#13 374.4 gyp info using node-gyp@5.1.1
#13 374.4 gyp info using node@14.17.3 | linux | x64
#13 374.4 gyp ERR! find Python 
#13 374.4 gyp ERR! find Python Python is not set from command line or npm configuration
#13 374.4 gyp ERR! find Python Python is not set from environment variable PYTHON
#13 374.4 gyp ERR! find Python checking if "python" can be used
#13 374.4 gyp ERR! find Python - "python" is not in PATH or produced an error
#13 374.4 gyp ERR! find Python checking if "python2" can be used
#13 374.4 gyp ERR! find Python - "python2" is not in PATH or produced an error
#13 374.4 gyp ERR! find Python checking if "python3" can be used
#13 374.4 gyp ERR! find Python - "python3" is not in PATH or produced an error
#13 374.4 gyp ERR! find Python 
#13 374.4 gyp ERR! find Python**********************************************************

To Reproduce At root run docker build .

Additional context Build succeeded when I added below lines after RUN apk add --no-cache libc6-compat git:

# for Node-canvas
RUN apk update
RUN apk --no-cache --virtual build-dependencies add \
    jpeg-dev \
    cairo-dev \
    giflib-dev \
    pango-dev \
    python3 \
    make \
    g++ 
v01t commented 2 years ago

can confirm mentioned issue and proposed extension of dockerfile that fix the issue

github-actions[bot] commented 2 years ago

This Issue has received no activity for 30 days. We will close it in 2 days, please reopen if you are still experiencing this issue.