s6 install tweaks

This commit is contained in:
ahgraber 2021-02-18 18:01:53 -05:00
parent 31c176042c
commit fdff767568
3 changed files with 30 additions and 16 deletions

View File

@ -1,7 +1,8 @@
# FROM ubuntu:focal # ARG TARGETPLATFORM
ARG TARGETPLATFORM # FROM --platform=${TARGETPLATFORM:-linux/amd64} ubuntu:focal
FROM --platform=${TARGETPLATFORM:-linux/amd64} ubuntu:focal FROM ubuntu:focal
ARG TARGETPLATFORM ARG TARGETPLATFORM
ARG TARGETARCH
ARG BUILD_DATE ARG BUILD_DATE
LABEL build_version="${TARGETPLATFORM} - ${BUILD_DATE}" LABEL build_version="${TARGETPLATFORM} - ${BUILD_DATE}"
@ -33,8 +34,13 @@ RUN apt-get update \
# s6 overlay # s6 overlay
COPY ./scripts/install-s6.sh /tmp/install-s6.sh COPY ./scripts/install-s6.sh /tmp/install-s6.sh
RUN chmod +x /tmp/install-s6.sh \ RUN chmod +x /tmp/install-s6.sh \
&& /tmp/install-s6.sh "${TARGETPLATFORM}" \ && /tmp/install-s6.sh ${TARGETPLATFORM} \
&& rm -f /tmp/install-s6 && 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 EXPOSE 80 443

View File

@ -1,6 +1,6 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
echo -e "Setting time sone:\\n\ echo -e "Setting time zone:\\n\
TIME ZONE=${TZ}\\n\ TIME ZONE=${TZ}\\n\
" "
TZ=${TZ:-"UTC"} TZ=${TZ:-"UTC"}

View File

@ -4,33 +4,41 @@
TARGETPLATFORM=$1 TARGETPLATFORM=$1
# S6_OVERLAY_VERSION="v2.2.0.3" S6_OVERLAY_VERSION=${2:-"latest"}
S6_OVERLAY_VERSION="latest" # S6_OVERLAY_VERSION="v2.1.0.3"
# Determine the correct binary file for the architecture given # Determine the correct binary file for the architecture given
case $TARGETPLATFORM in case $TARGETPLATFORM in
linux/arm64) linux/arm64)
S6_ARCH=aarch64 S6_ARCH=aarch64
;; ;;
linux/aarch64) linux/aarch64)
S6_ARCH=aarch64 S6_ARCH=aarch64
;; ;;
linux/arm/v7) linux/arm/v7)
S6_ARCH=armhf S6_ARCH=armhf
;; ;;
*) *)
S6_ARCH=amd64 S6_ARCH=amd64
;; ;;
esac 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/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" \ curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "${S6_URL}" \
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" \ && sleep 1 \
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin && 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." # 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."