-
Notifications
You must be signed in to change notification settings - Fork 0
/
arm64v8.dockerfile
50 lines (40 loc) · 1.04 KB
/
arm64v8.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
43
44
45
46
47
48
49
50
# :: Util
FROM alpine as util
RUN set -ex; \
apk add --no-cache \
git; \
git clone https://github.com/11notes/util.git;
# :: QEMU
FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu
# :: Header
FROM --platform=linux/arm64 11notes/node:stable
COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
ENV APP_ROOT=/labels
# :: Run
USER root
# :: prepare image
RUN set -ex; \
mkdir -p ${APP_ROOT}/lib; \
apk --no-cache add \
bind-tools; \
apk --no-cache upgrade;
COPY --from=util /util/node/util.js /labels/lib
# :: install
RUN set -ex; \
cd ${APP_ROOT}; \
npm --save install \
# :: update image
RUN set -ex; \
apk --no-cache upgrade;
# :: copy root filesystem changes and set correct permissions
COPY ./rootfs /
RUN set -ex; \
chmod +x -R /usr/local/bin; \
chown -R 1000:1000 \
${APP_ROOT};
# :: Start
USER docker
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]