-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (24 loc) · 808 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM amazonlinux:2
ARG LIBS=/usr/lib64
ARG OUT=/root
ARG NODE_VERSION=16
# set up container
RUN yum -y update \
&& yum -y groupinstall "Development Tools" \
&& curl --silent --location https://rpm.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& yum install -y nodejs gcc-c++ cairo-devel libjpeg-turbo-devel pango-devel giflib-devel
# will be created and become working dir
WORKDIR $OUT/nodejs
RUN npm install canvas
# will be created and become working dir
WORKDIR $OUT/lib
# gather missing libraries
RUN cp $LIBS/libblkid.so.1 . \
&& cp $LIBS/libmount.so.1 . \
&& cp $LIBS/libuuid.so.1 . \
&& cp $LIBS/libfontconfig.so.1 . \
&& cp $LIBS/libpixman-1.so.0 .
WORKDIR $OUT/dist/lib
# copy prebuilt and missing libs
RUN cp -r $OUT/nodejs/node_modules/canvas/build/Release/. . \
&& cp -a $OUT/lib/. .