Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
ubuntu 20.04, alpine 3.15, s6-overlay 3.1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu committed Apr 22, 2022
1 parent d08ede2 commit c1fd799
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-library/alpine}:3.12
FROM ${BASE_IMAGE:-library/alpine}:3.15

ARG QEMU_ARCH
ENV QEMU_ARCH=${QEMU_ARCH:-x86_64} S6_KEEP_ENV=1

ARG NODE_VERSION
ENV NODE_VERSION=${NODE_VERSION:-14.18.1}
ENV NODE_VERSION=${NODE_VERSION:-16.14.2}

ENV S6_OVERLAY_VERSION=3.1.0.1

COPY qemu/qemu-${QEMU_ARCH}-static /usr/bin/

RUN set -x && apk add --no-cache libgcc libstdc++ curl curl-dev coreutils tzdata shadow libstdc++ paxmark logrotate py3-pip \
RUN set -x && apk add --no-cache bash libgcc libstdc++ curl curl-dev coreutils tzdata shadow libstdc++ logrotate py3-pip \
&& case "${QEMU_ARCH}" in \
x86_64) S6_ARCH='amd64';; \
x86_64) S6_ARCH='x86_64';; \
arm) S6_ARCH='armhf';; \
aarch64) S6_ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -L -s https://github.com/just-containers/s6-overlay/releases/download/v1.21.1.1/s6-overlay-${S6_ARCH}.tar.gz | tar xvzf - -C / \
&& curl -SLO https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz \
&& tar -C / -Jxpf s6-overlay-noarch.tar.xz \
&& curl -SLO https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz \
&& tar -C / -Jxpf s6-overlay-${S6_ARCH}.tar.xz \
&& rm -rf s6-overlay-noarch.tar.xz s6-overlay-${S6_ARCH}.tar.xz \
&& groupmod -g 911 users \
&& useradd -u 911 -U -d /config -s /bin/false abc \
&& usermod -G users abc \
Expand All @@ -29,7 +35,6 @@ RUN set -x && apk add --no-cache libgcc libstdc++ curl curl-dev coreutils tzdata
RUN set -x && curl -fLO https://github.com/oznu/alpine-node/releases/download/${NODE_VERSION}/node-v${NODE_VERSION}-linux-${QEMU_ARCH}-alpine.tar.gz \
&& tar -xzf node-v${NODE_VERSION}-linux-${QEMU_ARCH}-alpine.tar.gz -C /usr --strip-components=1 --no-same-owner \
&& rm -rf node-v${NODE_VERSION}-linux-${QEMU_ARCH}-alpine.tar.gz \
&& paxmark `which node` \
&& npm set prefix /usr/local \
&& npm config set unsafe-perm true

Expand Down
25 changes: 15 additions & 10 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-library/ubuntu}:18.04
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:-14.18.1}
ENV NODE_VERSION=${NODE_VERSION:-16.14.2}

ENV S6_OVERLAY_VERSION=3.1.0.1

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 python3-setuptools \
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 \
&& case "${QEMU_ARCH}" in \
x86_64) S6_ARCH='amd64';; \
x86_64) S6_ARCH='x86_64';; \
arm) S6_ARCH='armhf';; \
aarch64) S6_ARCH='aarch64';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://github.com/just-containers/s6-overlay/releases/download/v1.21.1.1/s6-overlay-${S6_ARCH}.tar.gz" \
&& tar -xzf s6-overlay-${S6_ARCH}.tar.gz -C / \
&& tar -xzf s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin \
&& rm -rf s6-overlay-${S6_ARCH}.tar.gz \
&& curl -SLO https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz \
&& tar -C / -Jxpf s6-overlay-noarch.tar.xz \
&& curl -SLO https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz \
&& tar -C / -Jxpf s6-overlay-${S6_ARCH}.tar.xz \
&& rm -rf s6-overlay-noarch.tar.xz s6-overlay-${S6_ARCH}.tar.xz \
&& useradd -u 911 -U -d /config -s /bin/false abc \
&& usermod -G users abc \
&& mkdir -p /app /config /defaults \
&& apt-get install -y python3-pip \
&& pip3 install tzupdate \
&& apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* \
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/cont-init.d/10-adduser
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv sh
#!/command/with-contenv sh

PUID=${PUID:-911}
PGID=${PGID:-911}
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/cont-init.d/20-set-timezone
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv sh
#!/command/with-contenv sh

if [ $TZ ]; then
[ -f /usr/share/zoneinfo/$TZ ] && cp /usr/share/zoneinfo/$TZ /etc/localtime || echo "WARNING: $TZ is not a valid time zone."
Expand Down

0 comments on commit c1fd799

Please sign in to comment.