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

Support for docker - node:alpine #1886

Closed
vdemcak opened this issue Aug 26, 2021 · 4 comments
Closed

Support for docker - node:alpine #1886

vdemcak opened this issue Aug 26, 2021 · 4 comments

Comments

@vdemcak
Copy link

vdemcak commented Aug 26, 2021

Issue or Feature

Hey, I'm unable to install canvas 2.8.0 on my docker container which is running node:alpine. Every time npm wants to install this package I get node-gyp error. Could someone help me out with this? Thanks.

Steps to Reproduce

Try to install node-canvas on docker container running node:alpine image

Your Environment

  • Version of node-canvas : 2.8.0
  • Environment: latest Node
@vdemcak vdemcak closed this as completed Aug 27, 2021
@FoxxMD
Copy link

FoxxMD commented Sep 23, 2021

@vdemcak how did you resolve this?

@vdemcak
Copy link
Author

vdemcak commented Sep 23, 2021

I used this. Works like a charm while being tiny.

@FoxxMD
Copy link

FoxxMD commented Sep 23, 2021

Woah that is excellent! I'll be suggesting that to resemblejs team as a drop-in replacement...

In the meantime though I found my own solution. For posterity:

node-gfx/node-canvas-prebuilt#77 (comment)

Modify Dockerfile to include these lines somewhere before npm install --build-from-source

RUN apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev

RUN apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig

@vdemcak
Copy link
Author

vdemcak commented Sep 23, 2021

Yeah, I got it working in a similar way too but it increased the container size dramatically.

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

2 participants