mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 08:48:27 -04:00
Remove musl
This commit is contained in:
+2
-3
@@ -8,11 +8,10 @@ RUN apk add --no-cache curl jq && \
|
|||||||
MOD_VERSION=$(curl -s https://api.github.com/repos/rust-lang/rust/releases/latest | jq -r .tag_name); \
|
MOD_VERSION=$(curl -s https://api.github.com/repos/rust-lang/rust/releases/latest | jq -r .tag_name); \
|
||||||
fi && \
|
fi && \
|
||||||
mkdir -p /root-layer/rust-bins && \
|
mkdir -p /root-layer/rust-bins && \
|
||||||
SUPPORTED_PLATFORMS="x86_64-unknown-linux-musl x86_64-unknown-linux-gnu aarch64-unknown-linux-musl aarch64-unknown-linux-gnu" && \
|
SUPPORTED_PLATFORMS="x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu" && \
|
||||||
for PLATFORM in $SUPPORTED_PLATFORMS; do \
|
for PLATFORM in $SUPPORTED_PLATFORMS; do \
|
||||||
ARCH=${PLATFORM%%-*}; \
|
ARCH=${PLATFORM%%-*}; \
|
||||||
MUSL_OR_GNU=${PLATFORM##*-}; \
|
RUST_BINS=/root-layer/rust-bins/rust-${ARCH}-gnu.tar.gz; \
|
||||||
RUST_BINS=/root-layer/rust-bins/rust-${ARCH}-${MUSL_OR_GNU}.tar.gz; \
|
|
||||||
RUST_BINS_URL=https://static.rust-lang.org/dist/rust-${MOD_VERSION}-${PLATFORM}.tar.gz; \
|
RUST_BINS_URL=https://static.rust-lang.org/dist/rust-${MOD_VERSION}-${PLATFORM}.tar.gz; \
|
||||||
echo "Downloading rust for $PLATFORM"; \
|
echo "Downloading rust for $PLATFORM"; \
|
||||||
curl -o $RUST_BINS -sSf $RUST_BINS_URL; \
|
curl -o $RUST_BINS -sSf $RUST_BINS_URL; \
|
||||||
|
|||||||
@@ -12,5 +12,4 @@ Supported architectures:
|
|||||||
- [x] linux/aarch64
|
- [x] linux/aarch64
|
||||||
|
|
||||||
Supported docker base images:
|
Supported docker base images:
|
||||||
- [x] ubuntu:jammy (tested)
|
- [x] ubuntu:jammy
|
||||||
- [x] alpine (untested)
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
RUST_BINS_PATH="/rust-bins"
|
RUST_BINS_PATH="/rust-bins"
|
||||||
ALPINE_RELEASE_PATH="/etc/alpine-release"
|
|
||||||
PACKAGES_TO_INSTALL_LIST="/mod-repo-packages-to-install.list"
|
PACKAGES_TO_INSTALL_LIST="/mod-repo-packages-to-install.list"
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
@@ -14,23 +13,16 @@ if [[ ! " ${SUPPORTED_ARCHS[@]} " =~ " ${ARCH} " ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MUSL_OR_GNU=$(ldd /bin/sh | grep -q musl && echo "musl" || echo "gnu")
|
RUST_BINARY_ARCHIVE_PATH="$RUST_BINS_PATH/rust-$ARCH-gnu.tar.gz"
|
||||||
RUST_BINARY_ARCHIVE_PATH="$RUST_BINS_PATH/rust-$ARCH-$MUSL_OR_GNU.tar.gz"
|
|
||||||
|
|
||||||
grep_os_release() {
|
grep_os_release() {
|
||||||
grep -q "$1" /etc/os-release && echo true || echo false
|
grep -q "$1" /etc/os-release && true || false
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -f "$RUST_BINARY_ARCHIVE_PATH" ]]; then
|
if [[ -f "$RUST_BINARY_ARCHIVE_PATH" ]]; then
|
||||||
echo "+++ unpacking rust tar +++"
|
echo "+++ unpacking rust tar +++"
|
||||||
tar -xzf "$RUST_BINARY_ARCHIVE_PATH" -C "$RUST_BINS_PATH" --strip-components=1
|
tar -xzf "$RUST_BINARY_ARCHIVE_PATH" -C "$RUST_BINS_PATH" --strip-components=1
|
||||||
|
|
||||||
if [[ -f "$ALPINE_RELEASE_PATH" ]]; then
|
|
||||||
# in alpine ldconfig requires the configuration directory
|
|
||||||
sed -i 's/ldconfig/ldconfig \/etc\/ld.so.conf.d/g' "$RUST_BINS_PATH/install.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo "+++ installing rust +++"
|
echo "+++ installing rust +++"
|
||||||
"$RUST_BINS_PATH/install.sh"
|
"$RUST_BINS_PATH/install.sh"
|
||||||
rm -rf "$RUST_BINS_PATH"
|
rm -rf "$RUST_BINS_PATH"
|
||||||
@@ -38,8 +30,6 @@ if [[ -f "$RUST_BINARY_ARCHIVE_PATH" ]]; then
|
|||||||
echo "+++ adding build tools +++"
|
echo "+++ adding build tools +++"
|
||||||
if grep_os_release "debian"; then
|
if grep_os_release "debian"; then
|
||||||
echo "build-essential" >>"$PACKAGES_TO_INSTALL_LIST"
|
echo "build-essential" >>"$PACKAGES_TO_INSTALL_LIST"
|
||||||
elif grep_os_release "alpine"; then
|
|
||||||
echo "build-base" >>"$PACKAGES_TO_INSTALL_LIST"
|
|
||||||
else
|
else
|
||||||
echo "gcc" >>"$PACKAGES_TO_INSTALL_LIST"
|
echo "gcc" >>"$PACKAGES_TO_INSTALL_LIST"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user