-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.alpine
48 lines (45 loc) · 1.36 KB
/
Dockerfile.alpine
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
43
44
45
46
47
48
ARG ALPINE_VERSION=3.17
FROM docker.io/tiredofit/alpine:${ALPINE_VERSION}
LABEL maintainer="Dave Conroy (github.com/tiredofit)"
ARG NODE_VERSION
ENV NODE_VERSION=${NODE_VERSION:-"v18.7.0"}
RUN set -x && \
adduser -h /app -g "Node User" -D nodejs && \
apk add -t .node-build-deps \
binutils-gold \
g++ \
gcc \
linux-headers \
make \
python3 \
&& \
\
apk add -t .node-run-deps \
jq \
libstdc++ \
&& \
\
mkdir -p /usr/src/node && \
curl -sSL https://github.com/nodejs/node/archive/${NODE_VERSION}.tar.gz | tar xfz - --strip 1 -C /usr/src/node && \
cd /usr/src/node && \
./configure \
--prefix=/usr \
${CONFIG_FLAGS} \
&& \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install && \
cd / && \
npm install -g yarn && \
\
## Cleanup
apk del .node-build-deps && \
\
rm -rf /usr/sbin/python \
/usr/src/* \
/usr/share/man /tmp/* \
/var/cache/apk/* \
/root/.npm /root/.node-gyp \
/root/.gnupg /usr/lib/node_modules/npm/man \
/usr/lib/node_modules/npm/doc \
/usr/lib/node_modules/npm/html \
/usr/lib/node_modules/npm/scripts