Files
docker-traefik-labels/arm64v8.dockerfile
2024-01-18 09:28:42 +01:00

51 lines
1.2 KiB
Docker

# :: Util
FROM alpine as util
RUN set -ex; \
apk add --no-cache \
git; \
git clone https://github.com/11notes/util.git;
# :: Builder
FROM alpine AS qemu
ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz
RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . && mv qemu-3.0.0+resin-aarch64/qemu-aarch64-static .
# :: Header
FROM arm64v8/node:20.10.0-alpine3.19
COPY --from=qemu 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 \
redis@4.6.11 \
dockerode@4.0.0;
# :: 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"]