mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-28 18:14:50 -05:00
1ca3ebccd6
- Remove build-time dependencies - Remove cached NPM packages - Remove cached PyPi packages - Remove dependency descriptors. These still count against the total space, although it's a few KBs - Install rust-clippy and rust-fmt using the OS package manager instead of maintaining our own installation script - Add tests for build time dependencies that are not supposed to be installed
44 lines
1.1 KiB
Bash
Executable file
44 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
case $TARGETARCH in
|
|
amd64)
|
|
target=x86_64
|
|
;;
|
|
arm64)
|
|
target=arm64
|
|
;;
|
|
*)
|
|
echo "$TARGETARCH is not supported"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
url=$(
|
|
set -euo pipefail
|
|
curl -s \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
|
"https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases/tags/${GLIBC_VERSION}" |
|
|
jq --arg name "glibc-${GLIBC_VERSION}.apk" -r '.assets | .[] | select(.name | contains($name)) | .url'
|
|
)
|
|
curl --retry 5 --retry-delay 5 -sL -o "glibc-${GLIBC_VERSION}.apk" \
|
|
-H "Accept: application/octet-stream" \
|
|
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
|
"${url}"
|
|
apk add --no-cache --force-overwrite "glibc-${GLIBC_VERSION}.apk"
|
|
rm "glibc-${GLIBC_VERSION}.apk"
|
|
|
|
# Install zlib
|
|
mkdir /tmp/libz
|
|
|
|
apk add --no-cache --virtual .glibc-build-deps \
|
|
tar \
|
|
zstd
|
|
|
|
curl --retry 5 --retry-delay 5 -sL https://www.archlinux.org/packages/core/${target}/zlib/download | tar -x --zstd -C /tmp/libz
|
|
mv /tmp/libz/usr/lib/libz.so* /usr/glibc-compat/lib
|
|
rm -rf /tmp/libz
|
|
|
|
apk del --no-network --purge .glibc-build-deps
|