From 6350e3cb721634182e7f6f424cfc450dbf6aa01d Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 19 Aug 2020 12:22:01 +0200 Subject: [PATCH] support aarch64 --- Dockerfile | 25 +++++++++++++++++++++---- fetch-platform-rootfs | 17 +++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100755 fetch-platform-rootfs diff --git a/Dockerfile b/Dockerfile index c922eed..e4ca18f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,28 @@ -FROM alpine:3.12 +FROM alpine:3.12 AS builder LABEL maintainer="Sebastian Hugentobler " +ARG TARGETPLATFORM + ENV S6_OVERLAY_VERSION=v2.0.0.1 +ENV SHA256_amd64=df235428444be7737caf363e5dcfb58e3022fa611f5a27fe309ecd6fc1755cda +ENV SHA256_aarch64=5bc75be125409f0a22ba5a5b60f9150fa236bf858200809c91f72956326f8812 + +RUN apk --no-cache add \ + bash + +ADD fetch-platform-rootfs / +RUN ./fetch-platform-rootfs +RUN mkdir /overlay +RUN tar -xvf s6-overlay.tar.gz -C /overlay + +FROM alpine:3.12 + ENV LANG=en_US.UTF-8 - -RUN apk --no-cache add syslog-ng -RUN wget -qO- https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-amd64.tar.gz | tar -xz -C / + +COPY --from=builder /overlay / + +RUN apk --no-cache add \ + syslog-ng RUN apk --no-cache upgrade diff --git a/fetch-platform-rootfs b/fetch-platform-rootfs new file mode 100755 index 0000000..c276465 --- /dev/null +++ b/fetch-platform-rootfs @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -ex + +case $TARGETPLATFORM in + linux-arm64) + ARCH=aarch64 + ;; + *) + ARCH=amd64 + ;; + esac + +DOWNLOAD="https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-$ARCH.tar.gz" +wget "$DOWNLOAD" + +sha256_name=SHA256_$ARCH && echo "${!sha256_name} /s6-overlay-$ARCH.tar.gz" | sha256sum -c - || exit 1 +mv /s6-overlay-$ARCH.tar.gz /s6-overlay.tar.gz