From fdff767568ab33a6766a7e23a8fb62179ca5d6cd Mon Sep 17 00:00:00 2001 From: ahgraber Date: Thu, 18 Feb 2021 18:01:53 -0500 Subject: [PATCH] s6 install tweaks --- Dockerfile | 16 +++++++++----- root/etc/cont-init.d/02_set-timezone.sh | 2 +- scripts/install-s6.sh | 28 ++++++++++++++++--------- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 42e0f45..86cfde7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -# FROM ubuntu:focal -ARG TARGETPLATFORM -FROM --platform=${TARGETPLATFORM:-linux/amd64} ubuntu:focal +# ARG TARGETPLATFORM +# FROM --platform=${TARGETPLATFORM:-linux/amd64} ubuntu:focal +FROM ubuntu:focal ARG TARGETPLATFORM +ARG TARGETARCH ARG BUILD_DATE LABEL build_version="${TARGETPLATFORM} - ${BUILD_DATE}" @@ -33,8 +34,13 @@ RUN apt-get update \ # s6 overlay COPY ./scripts/install-s6.sh /tmp/install-s6.sh RUN chmod +x /tmp/install-s6.sh \ - && /tmp/install-s6.sh "${TARGETPLATFORM}" \ - && rm -f /tmp/install-s6 + && /tmp/install-s6.sh ${TARGETPLATFORM} \ + && rm -rf /tmp/* + +# ENV S6_ARCH=$(echo ${TARGETPLATFORM} | sed "s|linux\/||g") +# ADD https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-${S6_ARCH}-installer /tmp +# RUN /tmp/s6-overlay-${S6_ARCH}-installer / \ +# && rm -rf /tmp EXPOSE 80 443 diff --git a/root/etc/cont-init.d/02_set-timezone.sh b/root/etc/cont-init.d/02_set-timezone.sh index 3ed7fc8..bf2876b 100644 --- a/root/etc/cont-init.d/02_set-timezone.sh +++ b/root/etc/cont-init.d/02_set-timezone.sh @@ -1,6 +1,6 @@ #!/usr/bin/with-contenv bash -echo -e "Setting time sone:\\n\ +echo -e "Setting time zone:\\n\ TIME ZONE=${TZ}\\n\ " TZ=${TZ:-"UTC"} diff --git a/scripts/install-s6.sh b/scripts/install-s6.sh index 469dbf0..773df77 100644 --- a/scripts/install-s6.sh +++ b/scripts/install-s6.sh @@ -4,33 +4,41 @@ TARGETPLATFORM=$1 -# S6_OVERLAY_VERSION="v2.2.0.3" -S6_OVERLAY_VERSION="latest" +S6_OVERLAY_VERSION=${2:-"latest"} +# S6_OVERLAY_VERSION="v2.1.0.3" # Determine the correct binary file for the architecture given case $TARGETPLATFORM in linux/arm64) S6_ARCH=aarch64 ;; - linux/aarch64) S6_ARCH=aarch64 ;; - linux/arm/v7) S6_ARCH=armhf ;; - *) S6_ARCH=amd64 ;; esac -echo -e "Installing S6-overlay ${S6_OVERLAY_VERSION} for ${TARGETPLATFORM} (${S6_ARCH})" +echo -e "Downloading S6-overlay ${S6_OVERLAY_VERSION} for ${TARGETPLATFORM} (${S6_ARCH})" + +if [ S6_OVERLAY_VERSION="latest" ]; then + S6_URL="https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-${S6_ARCH}.tar.gz" +else + S6_URL="https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.gz" +fi # curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.gz" \ -curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "https://github.com/just-containers/s6-overlay/releases/latest/s6-overlay-${S6_ARCH}.tar.gz" \ - && tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" \ - && tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin +curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "${S6_URL}" \ + && sleep 1 \ + && tar xvzf "/tmp/s6-overlay-${S6_ARCH}.tar.gz" -C / --exclude="./bin" \ + && tar xvzf "/tmp/s6-overlay-${S6_ARCH}.tar.gz" -C /usr ./bin \ + && echo -e "S6-overlay install complete." -echo -e "S6-overlay install complete." \ No newline at end of file +# curl -L -o "/tmp/s6-overlay-installer" "${S6_URL}" \ +# && chmod +x "/tmp/s6-overlay-installer" \ +# && bash "/tmp/s6-overlay-installer" \ +# && echo -e "S6-overlay install complete." \ No newline at end of file