From aa02cd6fffa37619d2ea10fa929fb432fc80d48c Mon Sep 17 00:00:00 2001 From: Nico640 Date: Sun, 8 Nov 2020 15:19:00 +0100 Subject: [PATCH 1/4] switch to alpine 3.12 --- .github/workflows/docker-release.yml | 2 +- .github/workflows/docker-tag.yml | 2 +- .github/workflows/docker-test.yml | 2 +- Dockerfile | 50 ++++++---------------------- 4 files changed, 13 insertions(+), 43 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 453ac7a..5437b74 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -16,4 +16,4 @@ jobs: run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: Build and push Docker image - run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t nico640/s6-debian-node:latest -f Dockerfile --push . + run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t nico640/s6-alpine-node:latest -f Dockerfile --push . diff --git a/.github/workflows/docker-tag.yml b/.github/workflows/docker-tag.yml index eab8c02..4709f66 100644 --- a/.github/workflows/docker-tag.yml +++ b/.github/workflows/docker-tag.yml @@ -20,4 +20,4 @@ jobs: run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: Build and push Docker image - run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t nico640/s6-debian-node:$RELEASE_VERSION -f Dockerfile --push . + run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t nico640/s6-alpine-node:$RELEASE_VERSION -f Dockerfile --push . diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index a012e9e..46bf65d 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -16,4 +16,4 @@ jobs: run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: Build and push Docker image - run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t nico640/s6-debian-node:testing -f Dockerfile --push . + run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t nico640/s6-alpine-node:testing -f Dockerfile --push . diff --git a/Dockerfile b/Dockerfile index 32d6a91..b482b34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,56 +1,26 @@ -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 FROM base AS base-arm64 ENV S6_OVERLAY_ARCH=aarch64 -ENV NODE_ARCH=arm64 FROM base AS base-armv7 ENV S6_OVERLAY_ARCH=armhf -ENV NODE_ARCH=armv7l 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 / \ + && 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" ] \ No newline at end of file From 26d6107a2b84086612e832cf19d49442323d0a54 Mon Sep 17 00:00:00 2001 From: Nico640 Date: Sun, 8 Nov 2020 16:59:04 +0100 Subject: [PATCH 2/4] add var --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index b482b34..0af8e5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,17 +4,21 @@ ARG TARGETVARIANT FROM base AS base-amd64 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 APK_ARCH=aarch64 FROM base AS base-armv7 ENV S6_OVERLAY_ARCH=armhf +ENV APK_ARCH=armhf FROM base-${TARGETARCH}${TARGETVARIANT} 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 \ From c9f4b296499c34dfc41c83e26d0b28e7ee7342c0 Mon Sep 17 00:00:00 2001 From: Nico640 Date: Tue, 24 Nov 2020 23:24:23 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index da6300f..edaabc9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -[![GitHub Release](https://img.shields.io/github/v/release/Nico640/docker-s6-debian-node?style=flat-square)](https://github.com/nico640/docker-unms/releases) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Nico640/docker-s6-debian-node/Docker%20CI%20Release?style=flat-square)](https://github.com/Nico640/docker-s6-debian-node/actions?query=workflow%3A%22Docker+CI+Release%22) +[![GitHub Release](https://img.shields.io/github/v/release/Nico640/docker-s6-alpine-node?style=flat-square)](https://github.com/nico640/docker-s6-alpine-node/releases) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Nico640/docker-s6-alpine-node/Docker%20CI%20Release?style=flat-square)](https://github.com/Nico640/docker-s6-alpine-node/actions?query=workflow%3A%22Docker+CI+Release%22) -# s6-node +# s6-alpine-node This is a fork of [oznu/docker-s6-alpine-node](https://github.com/oznu/docker-s6-alpine-node) meant for maintaining [nico640/docker-unms](https://github.com/Nico640/docker-unms). This is a base Node.js image with the S6 Overlay and support for x86_64 and ARM (Raspberry Pi 1, 2, 3, 4). @@ -13,5 +13,5 @@ Debian Linux + [S6 Overlay](https://github.com/just-containers/s6-overlay) + [No See the [S6 Overlay Documentation](https://github.com/just-containers/s6-overlay) for details on how to manage services. ```shell -docker run nico640/s6-debian-node:latest +docker run nico640/s6-alpine-node:latest ``` From 220f586a2c55a5cbb9a35f2745b3e6f6cf3526a4 Mon Sep 17 00:00:00 2001 From: Nico640 Date: Tue, 24 Nov 2020 23:27:32 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index edaabc9..8afb9c5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is a fork of [oznu/docker-s6-alpine-node](https://github.com/oznu/docker-s6 This is a base Node.js image with the S6 Overlay and support for x86_64 and ARM (Raspberry Pi 1, 2, 3, 4). -Debian Linux + [S6 Overlay](https://github.com/just-containers/s6-overlay) + [Node](https://nodejs.org/en/) +Alpine Linux + [S6 Overlay](https://github.com/just-containers/s6-overlay) + [Node](https://nodejs.org/en/) ## Usage