diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index 67dd2d4b..460f9cda 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -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: @@ -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 @@ -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: @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 00730a4c..ce2a298f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/ diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-julia-install/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-julia-install/run index f4f49d85..7082c6c0 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-julia-install/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-julia-install/run @@ -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