2018-05-09 15:23:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
# Install build utilities
|
2020-12-17 10:51:26 +00:00
|
|
|
apk --no-cache add curl jq
|
2018-05-09 15:23:04 +00:00
|
|
|
|
2020-12-17 10:51:26 +00:00
|
|
|
# Get latest versions of tools using Github API
|
|
|
|
ASSET_URL=$(
|
|
|
|
curl -s "https://api.github.com/repos/Yelp/dumb-init/releases/latest" |
|
|
|
|
jq -r '.assets[] | .browser_download_url' |
|
|
|
|
grep "$(uname -m)$"
|
|
|
|
)
|
|
|
|
[[ -n $ASSET_URL ]] || exit 1
|
2018-05-09 15:23:04 +00:00
|
|
|
|
|
|
|
# Install tools
|
2020-12-17 10:51:26 +00:00
|
|
|
curl -sSfLo /usr/local/bin/dumb-init "${ASSET_URL}"
|
2018-05-09 15:23:04 +00:00
|
|
|
chmod +x /usr/local/bin/dumb-init
|
|
|
|
|
|
|
|
# Cleanup
|
2020-12-17 10:51:26 +00:00
|
|
|
apk --no-cache del curl jq
|