forked from oznu/docker-s6-alpine-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
19 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,30 @@ | ||
FROM debian:9.13-slim AS base | ||
FROM node:12.18.4-alpine3.12 AS base | ||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
|
||
FROM base AS base-amd64 | ||
ENV S6_OVERLAY_ARCH=amd64 | ||
ENV NODE_ARCH=x64 | ||
ENV S6_OVERLAY_ARCH=amd64 S6_KEEP_ENV=1 | ||
ENV APK_ARCH=x86_64 | ||
|
||
FROM base AS base-arm64 | ||
ENV S6_OVERLAY_ARCH=aarch64 | ||
ENV NODE_ARCH=arm64 | ||
ENV APK_ARCH=aarch64 | ||
|
||
FROM base AS base-armv7 | ||
ENV S6_OVERLAY_ARCH=armhf | ||
ENV NODE_ARCH=armv7l | ||
ENV APK_ARCH=armhf | ||
|
||
FROM base-${TARGETARCH}${TARGETVARIANT} | ||
|
||
RUN set -x && apt-get update \ | ||
&& apt-get install -y curl tzdata locales psmisc procps iputils-ping logrotate \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& curl -SLO "https://github.com/just-containers/s6-overlay/releases/download/v1.21.1.1/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz" \ | ||
&& tar -xzf s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / \ | ||
&& tar -xzf s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin \ | ||
&& rm -rf s6-overlay-${S6_OVERLAY_ARCH}.tar.gz \ | ||
&& useradd -u 911 -U -d /config -s /bin/false abc \ | ||
&& usermod -G users abc \ | ||
&& mkdir -p /app /config /defaults \ | ||
&& 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 | ||
|
||
ENV NODE_VERSION 10.19.0 | ||
|
||
RUN 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 | ||
|
||
ENV YARN_VERSION 1.21.1 | ||
|
||
RUN set -ex \ | ||
&& curl -fSLO "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ | ||
&& mkdir -p /opt/yarn \ | ||
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ | ||
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ | ||
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ | ||
&& rm yarn-v$YARN_VERSION.tar.gz | ||
RUN set -x && apk add --no-cache curl tzdata logrotate shadow coreutils libstdc++ \ | ||
&& curl -SL "https://github.com/just-containers/s6-overlay/releases/download/v2.1.0.2/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz" | tar xvz -C / \ | ||
&& groupmod -g 911 users \ | ||
&& useradd -u 911 -U -d /config -s /bin/false abc \ | ||
&& usermod -G users abc \ | ||
&& mkdir -p /app /config /defaults \ | ||
&& sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
COPY rootfs / | ||
|
||
ENTRYPOINT [ "/init" ] | ||
ENTRYPOINT [ "/init" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters