Skip to content

Commit

Permalink
Merge pull request #841 from linuxserver/code-server-julia-multi
Browse files Browse the repository at this point in the history
julia: switch to multi-arch
  • Loading branch information
aptalca committed Feb 18, 2024
2 parents 0317790 + a8dcba0 commit cfc9799
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/BuildImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
ENDPOINT: "linuxserver/mods" #don't modify
BASEIMAGE: "code-server" #replace
MODNAME: "julia" #replace
MULTI_ARCH: "true" #set to true if needed

jobs:
set-vars:
Expand All @@ -19,6 +20,7 @@ jobs:
echo "ENDPOINT=${{ env.ENDPOINT }}" >> $GITHUB_OUTPUT
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
MOD_VERSION=$(curl -sL https://julialang.org/downloads/ | grep 'Current stable release:' | sed 's|.*Current stable release: v||' | sed 's| (.*||')
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
Expand All @@ -27,6 +29,7 @@ jobs:
ENDPOINT: ${{ steps.outputs.outputs.ENDPOINT }}
BASEIMAGE: ${{ steps.outputs.outputs.BASEIMAGE }}
MODNAME: ${{ steps.outputs.outputs.MODNAME }}
MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }}
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}

build:
Expand All @@ -42,4 +45,5 @@ jobs:
ENDPOINT: ${{ needs.set-vars.outputs.ENDPOINT }}
BASEIMAGE: ${{ needs.set-vars.outputs.BASEIMAGE }}
MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }}
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ RUN \
fi && \
JULIA_MIN_VERSION=$(echo "${MOD_VERSION}" | cut -d. -f 1,2) && \
mkdir -p /root-layer/julia-bins && \
echo "**** Downloading x86_64 binary ****" && \
curl -fL "https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_MIN_VERSION}/julia-${MOD_VERSION}-linux-x86_64.tar.gz" -o \
"/root-layer/julia-bins/julia-x86_64.tar.gz" && \
echo "**** Downloading aarch64 binary ****" && \
curl -fL "https://julialang-s3.julialang.org/bin/linux/aarch64/${JULIA_MIN_VERSION}/julia-${MOD_VERSION}-linux-aarch64.tar.gz" -o \
"/root-layer/julia-bins/julia-aarch64.tar.gz"
if [ $(uname -m) = "x86_64" ]; then \
echo "**** Downloading x86_64 binary ****" && \
curl -fL "https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_MIN_VERSION}/julia-${MOD_VERSION}-linux-x86_64.tar.gz" -o \
"/root-layer/julia-bins/julia.tar.gz"; \
elif [ $(uname -m) = "aarch64" ]; then \
echo "**** Downloading aarch64 binary ****" && \
curl -fL "https://julialang-s3.julialang.org/bin/linux/aarch64/${JULIA_MIN_VERSION}/julia-${MOD_VERSION}-linux-aarch64.tar.gz" -o \
"/root-layer/julia-bins/julia.tar.gz"; \
fi

COPY root/ /root-layer/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ fi
if [ -d "/julia-bins" ]; then
echo "**** Installing/updating Julia ****"
mkdir -p /julia
tar xf "/julia-bins/julia-${ARCH}.tar.gz" -C \
tar xf "/julia-bins/julia.tar.gz" -C \
/julia --strip-components=1
rm -rf /usr/local/bin/julia
ln -s /julia/bin/julia /usr/local/bin/julia
chmod +x /julia/bin/julia
rm -rf /julia-bins
else
echo "**** Latest stable version of Julia already installed ****"
fi
Expand Down

0 comments on commit cfc9799

Please sign in to comment.