Skip to content

Commit

Permalink
ARM architecture: Goss + S6 require architecture detection for packag…
Browse files Browse the repository at this point in the history
…es (#64)

* Goss / S6: added architecture detection

* S6: updated public key location

* Scripts: [[ vs [

Co-authored-by: Bryan Latten <latten@adobe.com>
  • Loading branch information
bryanlatten and Bryan Latten authored Oct 12, 2021
1 parent c224765 commit 3a5ddd5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
18 changes: 15 additions & 3 deletions container/root/scripts/install_goss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 16 additions & 3 deletions container/root/scripts/install_s6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a5ddd5

Please sign in to comment.