This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.ubuntu
56 lines (47 loc) · 2.07 KB
/
Dockerfile.ubuntu
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
51
52
53
54
55
56
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-library/ubuntu}:20.04
ARG QEMU_ARCH
ENV QEMU_ARCH=${QEMU_ARCH:-x86_64} S6_KEEP_ENV=1
ARG NODE_VERSION
ENV NODE_VERSION=${NODE_VERSION:-16.14.2}
ENV S6_OVERLAY_VERSION=2.2.0.3
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
COPY qemu/qemu-${QEMU_ARCH}-static /usr/bin/
RUN set -x \
&& apt-get update \
&& apt-get install -y curl wget tzdata locales psmisc procps iputils-ping logrotate libatomic1 apt-transport-https apt-utils \
&& locale-gen en_US.UTF-8 \
&& ln -snf /usr/share/zoneinfo/Etc/GMT /etc/localtime && echo Etc/GMT > /etc/timezone \
&& apt-get install -y python3 python3-pip python3-setuptools \
&& useradd -u 911 -U -d /config -s /bin/false abc \
&& usermod -G users abc \
&& mkdir -p /app /config /defaults \
&& pip3 install tzupdate \
&& apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* \
&& rm -rf /etc/cron.daily/apt-compat /etc/cron.daily/dpkg /etc/cron.daily/passwd /etc/cron.daily/exim4-base \
&& sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf
RUN case "${QEMU_ARCH}" in \
x86_64) S6_ARCH='amd64';; \
arm) S6_ARCH='armhf';; \
aarch64) S6_ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& cd /tmp \
&& curl -SLO https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}-installer \
&& chmod +x /tmp/s6-overlay-${S6_ARCH}-installer && /tmp/s6-overlay-${S6_ARCH}-installer /
RUN case "${QEMU_ARCH}" in \
x86_64) NODE_ARCH='x64';; \
arm) NODE_ARCH='armv7l';; \
aarch64) NODE_ARCH='arm64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
&& tar -xzf "node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& npm set prefix /usr/local \
&& npm config set unsafe-perm true
COPY rootfs /
ENTRYPOINT [ "/init" ]