-
Notifications
You must be signed in to change notification settings - Fork 45
/
Dockerfile
42 lines (34 loc) · 1.03 KB
/
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
33
34
35
36
37
38
39
40
41
42
FROM arm64v8/amazonlinux:latest
ARG OUT=/root/layers
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 \
python37 \
which \
binutils \
sed \
gcc-c++ \
cairo-devel \
libjpeg-turbo-devel \
pango-devel \
giflib-devel
# will be created and become working dir
WORKDIR $OUT/nodejs
RUN npm install --build-from-source \
canvas@2 \
chartjs-plugin-datalabels@2 \
chartjs-node-canvas@4 \
chart.js@3
# will be created and become working dir
WORKDIR $OUT/lib
# gather missing libraries
RUN curl https://raw.githubusercontent.com/ncopa/lddtree/v1.26/lddtree.sh -o $OUT/lddtree.sh \
&& chmod +x $OUT/lddtree.sh \
&& cp $($OUT/lddtree.sh -l $OUT/nodejs/node_modules/canvas/build/Release/canvas.node | grep '^\/lib' | sed -r -e '/canvas.node$/d') .
WORKDIR $OUT
RUN zip -r -9 node${NODE_VERSION}_canvas_layer.zip nodejs \
&& zip -r -9 node${NODE_VERSION}_canvas_lib64_layer.zip lib