diff --git a/.travis.yml b/.travis.yml index 4f3133e..fda1acd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,10 @@ before_install: # install goss - curl -L https://goss.rocks/install | sudo sh +arch: + - amd64 + - arm64 + script: - docker build -f Dockerfile-alpine . - docker build -f Dockerfile-centos-7 . diff --git a/container/root/scripts/install_goss.sh b/container/root/scripts/install_goss.sh index 89d883c..dd5ed8c 100644 --- a/container/root/scripts/install_goss.sh +++ b/container/root/scripts/install_goss.sh @@ -8,10 +8,22 @@ GOSS_VERSION=v0.3.16 -# Manually locate and commit from https://github.com/aelsabbahy/goss/releases/download/vX.Y.Z/goss-linux-amd64.sha256 -GOSS_SHA256=827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb +# Locate manually and commit below from https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/goss-linux-${ARCH}.sha256 +GOSS_SHA256="" +# Determined automatically to correctly select binary +ARCH="" -curl -fL https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/goss-linux-amd64 -o /usr/local/bin/goss +if [[ "$(uname -m)" = "x86_64" ]]; then + echo "[goss install] Detected x86_64 architecture" + ARCH="amd64" + GOSS_SHA256=827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb +elif [[ "$(uname -m)" = "aarch64" ]]; then + echo "[goss install] Detected ARM architecture" + ARCH="arm" + GOSS_SHA256=67c1e6185759a25bf9db334a9fe795a25708f2b04abe808a87d72edd6cd393fd +fi; + +curl -fL https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/goss-linux-${ARCH} -o /usr/local/bin/goss # NOTE: extra whitespace between SHA sum and location is intentional, required for Alpine echo "${GOSS_SHA256} /usr/local/bin/goss" | sha256sum -c - 2>&1 | grep OK diff --git a/container/root/scripts/install_s6.sh b/container/root/scripts/install_s6.sh index b1426cd..0639c0a 100755 --- a/container/root/scripts/install_s6.sh +++ b/container/root/scripts/install_s6.sh @@ -6,13 +6,26 @@ # Downloads, verifies, and extracts # Requires curl, gpg (or gnupg on Alpine), and tar to be present -S6_NAME=s6-overlay-amd64.tar.gz +# Determined automatically to correctly select binary +ARCH="" + +if [[ "$(uname -m)" = "x86_64" ]]; then + echo "[s6 install] Detected x86_64 architecture" + ARCH="amd64" +elif [[ "$(uname -m)" = "aarch64" ]]; then + echo "[s6 install] Detected ARM architecture" + ARCH="aarch64" +fi; + +S6_NAME=s6-overlay-${ARCH}.tar.gz S6_VERSION=v2.2.0.3 +PUBLIC_KEY=6101B2783B2FD161 curl -fL https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/${S6_NAME} -o /tmp/${S6_NAME} curl -fL https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/${S6_NAME}.sig -o /tmp/${S6_NAME}.sig -curl https://keybase.io/justcontainers/key.asc| gpg --no-tty --batch --import -gpg --no-tty --batch --verify /tmp/${S6_NAME}.sig /tmp/${S6_NAME} + +gpg --keyserver pgp.surfnet.nl --recv-keys $PUBLIC_KEY +gpg --verify /tmp/${S6_NAME}.sig /tmp/${S6_NAME} # Special handling - CentOS >= 7 + Ubuntu >= 20.04 # @see https://github.com/just-containers/s6-overlay#bin-and-sbin-are-symlinks