File tree Expand file tree Collapse file tree 3 files changed +26
-25
lines changed
root/etc/s6-overlay/s6-rc.d/init-mod-code-server-rust-install Expand file tree Collapse file tree 3 files changed +26
-25
lines changed Original file line number Diff line number Diff line change 77 ENDPOINT : " linuxserver/mods" # don't modify
88 BASEIMAGE : " code-server"
99 MODNAME : " rust"
10+ MULTI_ARCH : " true" # set to true if needed
1011
1112jobs :
1213 set-vars :
1920 echo "ENDPOINT=${{ env.ENDPOINT }}" >> $GITHUB_OUTPUT
2021 echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
2122 echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
23+ echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
2224 # **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
2325 MOD_VERSION=$(curl -s https://api.github.com/repos/rust-lang/rust/releases/latest | jq -r .tag_name)
2426 echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
2729 ENDPOINT : ${{ steps.outputs.outputs.ENDPOINT }}
2830 BASEIMAGE : ${{ steps.outputs.outputs.BASEIMAGE }}
2931 MODNAME : ${{ steps.outputs.outputs.MODNAME }}
32+ MULTI_ARCH : ${{ steps.outputs.outputs.MULTI_ARCH }}
3033 MOD_VERSION : ${{ steps.outputs.outputs.MOD_VERSION }}
3134
3235 build :
4245 ENDPOINT : ${{ needs.set-vars.outputs.ENDPOINT }}
4346 BASEIMAGE : ${{ needs.set-vars.outputs.BASEIMAGE }}
4447 MODNAME : ${{ needs.set-vars.outputs.MODNAME }}
48+ MULTI_ARCH : ${{ needs.set-vars.outputs.MULTI_ARCH }}
4549 MOD_VERSION : ${{ needs.set-vars.outputs.MOD_VERSION }}
Original file line number Diff line number Diff line change @@ -3,18 +3,23 @@ FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as buildstage
33
44ARG MOD_VERSION
55
6- RUN if [ -z "$MOD_VERSION" ]; then \
6+ RUN \
7+ echo "**** Retrieving rust version ****" && \
8+ if [ -z "$MOD_VERSION" ]; then \
79 MOD_VERSION=$(curl -s https://api.github.com/repos/rust-lang/rust/releases/latest | jq -r .tag_name); \
810 fi && \
911 mkdir -p /root-layer/rust-bins && \
10- SUPPORTED_PLATFORMS="x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu" && \
11- for PLATFORM in $SUPPORTED_PLATFORMS; do \
12- ARCH=${PLATFORM%%-*}; \
13- RUST_BINS=/root-layer/rust-bins/rust-${ARCH}-gnu.tar.gz; \
14- RUST_BINS_URL=https://static.rust-lang.org/dist/rust-${MOD_VERSION}-${PLATFORM}.tar.gz; \
15- echo "Downloading rust for $PLATFORM" ; \
16- curl -o $RUST_BINS -sSf $RUST_BINS_URL; \
17- done;
12+ if [ $(uname -m) = "x86_64" ]; then \
13+ echo "**** Downloading x86_64 tarball ****" && \
14+ curl -fo \
15+ /root-layer/rust-bins/rust.tar.gz -L \
16+ "https://static.rust-lang.org/dist/rust-${MOD_VERSION}-x86_64-unknown-linux-gnu.tar.gz" ; \
17+ elif [ $(uname -m) = "aarch64" ]; then \
18+ echo "**** Downloading aarch64 tarball ****" && \
19+ curl -fo \
20+ /root-layer/rust-bins/rust.tar.gz -L \
21+ "https://static.rust-lang.org/dist/rust-${MOD_VERSION}-aarch64-unknown-linux-gnu.tar.gz" ; \
22+ fi
1823
1924COPY root/ /root-layer/
2025
Original file line number Diff line number Diff line change 22
33set -e
44
5- RUST_BINS_PATH="/rust-bins"
6- PACKAGES_TO_INSTALL_LIST="/mod-repo-packages-to-install.list"
7-
85ARCH=$(uname -m)
9- SUPPORTED_ARCHS=("x86_64" "aarch64")
10-
11- if [[ ! " ${SUPPORTED_ARCHS[@]} " =~ " ${ARCH} " ]]; then
12- echo "**** unsupported architecture: $ARCH ****"
13- exit 1
6+ if [[ "${ARCH}" = "armv7l" ]]; then
7+ echo "**** The docker mods no longer support arm32v7/armhf per https://info.linuxserver.io/issues/2023-07-01-armhf/ ****"
8+ exit 0
149fi
1510
1611if ! dpkg -l | grep build-essential >/dev/null; then
1712 echo "**** adding build-essential to install list ****"
18- echo "build-essential" >>"$PACKAGES_TO_INSTALL_LIST"
13+ echo "build-essential" >> /mod-repo-packages-to-install.list
1914else
2015 echo "**** build-essential already installed ****"
2116fi
2217
23- RUST_BINARY_ARCHIVE_PATH="$RUST_BINS_PATH/rust-$ARCH-gnu.tar.gz"
24-
25- if [[ -f "$RUST_BINARY_ARCHIVE_PATH" ]]; then
18+ if [[ -f /rust-bins/rust.tar.gz ]]; then
2619 echo "**** unpacking rust tar ****"
27- tar -xzf "$RUST_BINARY_ARCHIVE_PATH" -C "$RUST_BINS_PATH" --strip-components=1
28-
20+ tar -xzf /rust-bins/rust.tar.gz -C /rust-bins --strip-components=1
2921 echo "**** installing rust ****"
30- "$RUST_BINS_PATH/ install.sh"
31- rm -rf "$RUST_BINS_PATH"
22+ /rust-bins/ install.sh
23+ rm -rf /rust-bins/rust.tar.gz
3224else
3325 echo "**** latest rust is already installed ****"
3426fi
You can’t perform that action at this time.
0 commit comments