diff --git a/.architectures-lib b/.architectures-lib deleted file mode 100644 index ddfc2fe3..00000000 --- a/.architectures-lib +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -_awkArch() { - local version="$1"; shift - local awkExpr="$1"; shift - local file="$version/release-architectures" - [ -f "$file" ] || file='release-architectures' - awk "$@" "/^#|^\$/ { next } $awkExpr" "$file" -} - -dpkgArches() { - local version="$1"; shift - _awkArch "$version" '{ print $2 }' -} - -hasBashbrewArch() { - local version="$1"; shift - local bashbrewArch="$1"; shift - _awkArch "$version" 'BEGIN { exitCode = 1 } $1 == bashbrewArch { exitCode = 0 } END { exit exitCode }' -v bashbrewArch="$bashbrewArch" -} - -dpkgToBashbrewArch() { - local version="$1"; shift - local dpkgArch="$1"; shift - _awkArch "$version" '$2 == dpkgArch { print $1; exit }' -v dpkgArch="$dpkgArch" -} - -dpkgToJuliaTarArch() { - local version="$1"; shift - local dpkgArch="$1"; shift - _awkArch "$version" '$2 == dpkgArch { print $3; exit }' -v dpkgArch="$dpkgArch" -} - -dpkgToJuliaDirArch() { - local version="$1"; shift - local dpkgArch="$1"; shift - _awkArch "$version" '$2 == dpkgArch { print $4; exit }' -v dpkgArch="$dpkgArch" -} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..14a11226 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +/*/**/Dockerfile linguist-generated +/*/**/docker-entrypoint.sh linguist-generated +/Dockerfile*.template linguist-language=Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d85dc80d..cfb2e5cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,16 +18,16 @@ jobs: outputs: strategy: ${{ steps.generate-jobs.outputs.strategy }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 + - uses: docker-library/bashbrew@HEAD - id: generate-jobs name: Generate Jobs run: | - git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew - strategy="$(~/bashbrew/scripts/github-actions/generate.sh)" - strategy="$(~/bashbrew/scripts/github-actions/munge-i386.sh -c <<<"$strategy")" + strategy="$("$BASHBREW_SCRIPTS/github-actions/generate.sh")" + strategy="$("$BASHBREW_SCRIPTS/github-actions/munge-i386.sh" -c <<<"$strategy")" strategy="$(jq -c <<<"$strategy" '.matrix.include = [ .matrix.include[] | select(.name | test("alpine.*i386") | not) ]')" # Alpine releases do not exist for i386 + echo "strategy=$strategy" >> "$GITHUB_OUTPUT" jq . <<<"$strategy" # sanity check / debugging aid - echo "::set-output name=strategy::$strategy" test: needs: generate-jobs @@ -35,7 +35,7 @@ jobs: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Prepare Environment run: ${{ matrix.runs.prepare }} - name: Pull Dependencies diff --git a/.github/workflows/verify-templating.yml b/.github/workflows/verify-templating.yml new file mode 100644 index 00000000..e822ba6b --- /dev/null +++ b/.github/workflows/verify-templating.yml @@ -0,0 +1,19 @@ +name: Verify Templating + +on: + pull_request: + push: + workflow_dispatch: + +defaults: + run: + shell: 'bash -Eeuo pipefail -x {0}' + +jobs: + apply-templates: + name: Check For Uncomitted Changes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: ./apply-templates.sh + - run: git diff --exit-code diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..d548f66d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.jq-template.awk diff --git a/1.0/bullseye/Dockerfile b/1.0/bullseye/Dockerfile deleted file mode 100644 index 2441a8fd..00000000 --- a/1.0/bullseye/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM debian:bullseye-slim - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ -# ERROR: no download agent available; install curl, wget, or fetch - curl \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.0.5 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - if ! command -v gpg > /dev/null; then \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gnupg \ - dirmngr \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.0.5.sha256 -# this "case" statement is generated via "update.sh" - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ -# amd64 - amd64) tarArch='x86_64'; dirArch='x64'; sha256='9dedd613777ba6ebd8aee5796915ff50aa6188ea03ed143cb687fc2aefd76b03' ;; \ -# arm32v7 - armhf) tarArch='armv7l'; dirArch='armv7l'; sha256='cfb2712765db90f0e4fa27e57a88c6d994ebcf1781f8673ebb17b5df7962d0c5' ;; \ -# arm64v8 - arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='41cea1336ed8861413bb945740e567360e26f241eb3e10b3bb0fccd25655ed28' ;; \ -# i386 - i386) tarArch='i686'; dirArch='x86'; sha256='67c8f31699b79df96ce95926a363cd24ffa5bb4d9a814e071b1e8c8ff33e5a8f' ;; \ - *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ - curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.0/buster/Dockerfile b/1.0/buster/Dockerfile deleted file mode 100644 index e1af0260..00000000 --- a/1.0/buster/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM debian:buster-slim - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ -# ERROR: no download agent available; install curl, wget, or fetch - curl \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.0.5 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - if ! command -v gpg > /dev/null; then \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gnupg \ - dirmngr \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.0.5.sha256 -# this "case" statement is generated via "update.sh" - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ -# amd64 - amd64) tarArch='x86_64'; dirArch='x64'; sha256='9dedd613777ba6ebd8aee5796915ff50aa6188ea03ed143cb687fc2aefd76b03' ;; \ -# arm32v7 - armhf) tarArch='armv7l'; dirArch='armv7l'; sha256='cfb2712765db90f0e4fa27e57a88c6d994ebcf1781f8673ebb17b5df7962d0c5' ;; \ -# arm64v8 - arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='41cea1336ed8861413bb945740e567360e26f241eb3e10b3bb0fccd25655ed28' ;; \ -# i386 - i386) tarArch='i686'; dirArch='x86'; sha256='67c8f31699b79df96ce95926a363cd24ffa5bb4d9a814e071b1e8c8ff33e5a8f' ;; \ - *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ - curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.0/windows/windowsservercore-1809/Dockerfile b/1.0/windows/windowsservercore-1809/Dockerfile deleted file mode 100644 index 45f7fbd8..00000000 --- a/1.0/windows/windowsservercore-1809/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:1809 - -# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ENV JULIA_VERSION 1.0.5 -ENV JULIA_SHA256 83c04bdc264e7ab87f4e22be9f3dff8c5a62a49c8edea6a0c85f4645d4cbac7a - -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ - \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ - if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ - Write-Host 'Installing ...'; \ - Start-Process -Wait -NoNewWindow \ - -FilePath '.\julia.exe' \ - -ArgumentList @( \ - '/S', \ - '/D=C:\julia' \ - ); \ - \ - Write-Host 'Updating PATH ...'; \ - $env:PATH = 'C:\julia\bin;' + $env:PATH; \ - [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ("julia --version") ...'; \ - julia --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ - Write-Host 'Complete.' - -CMD ["julia"] diff --git a/1.0/windows/windowsservercore-ltsc2016/Dockerfile b/1.0/windows/windowsservercore-ltsc2016/Dockerfile deleted file mode 100644 index fdce3743..00000000 --- a/1.0/windows/windowsservercore-ltsc2016/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2016 - -# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ENV JULIA_VERSION 1.0.5 -ENV JULIA_SHA256 83c04bdc264e7ab87f4e22be9f3dff8c5a62a49c8edea6a0c85f4645d4cbac7a - -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ - \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ - if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ - Write-Host 'Installing ...'; \ - Start-Process -Wait -NoNewWindow \ - -FilePath '.\julia.exe' \ - -ArgumentList @( \ - '/S', \ - '/D=C:\julia' \ - ); \ - \ - Write-Host 'Updating PATH ...'; \ - $env:PATH = 'C:\julia\bin;' + $env:PATH; \ - [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ("julia --version") ...'; \ - julia --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ - Write-Host 'Complete.' - -CMD ["julia"] diff --git a/1.0/windows/windowsservercore-ltsc2022/Dockerfile b/1.0/windows/windowsservercore-ltsc2022/Dockerfile deleted file mode 100644 index f6418589..00000000 --- a/1.0/windows/windowsservercore-ltsc2022/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2022 - -# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ENV JULIA_VERSION 1.0.5 -ENV JULIA_SHA256 83c04bdc264e7ab87f4e22be9f3dff8c5a62a49c8edea6a0c85f4645d4cbac7a - -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ - \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ - if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ - Write-Host 'Installing ...'; \ - Start-Process -Wait -NoNewWindow \ - -FilePath '.\julia.exe' \ - -ArgumentList @( \ - '/S', \ - '/D=C:\julia' \ - ); \ - \ - Write-Host 'Updating PATH ...'; \ - $env:PATH = 'C:\julia\bin;' + $env:PATH; \ - [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ("julia --version") ...'; \ - julia --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ - Write-Host 'Complete.' - -CMD ["julia"] diff --git a/1.10/bookworm/Dockerfile b/1.10/bookworm/Dockerfile new file mode 100644 index 00000000..3c1f6dca --- /dev/null +++ b/1.10/bookworm/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ +# ERROR: no download agent available; install curl, wget, or fetch + curl \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JULIA_PATH /usr/local/julia +ENV PATH $JULIA_PATH/bin:$PATH + +# https://julialang.org/juliareleases.asc +# Julia (Binary signing key) +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 + +# https://julialang.org/downloads/ +ENV JULIA_VERSION 1.10.7 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-1.10.7.sha256 + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + url='https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.7-linux-x86_64.tar.gz'; \ + sha256='21b2c69806aacf191d7c81806c7d9918bddab30c7b5b8d4251389c3abe274334'; \ + ;; \ + 'arm64') \ + url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.10/julia-1.10.7-linux-aarch64.tar.gz'; \ + sha256='93bf1b113f297c817310f77d1edce4ab9dcbf49432489cb8df09afbf93d1e5a0'; \ + ;; \ + 'i386') \ + url='https://julialang-s3.julialang.org/bin/linux/x86/1.10/julia-1.10.7-linux-i686.tar.gz'; \ + sha256='3e5afefd8a77d1e96b7037bfcd23def8f8993e3d0ca8408fffb292fa60a25cd0'; \ + ;; \ + 'ppc64el') \ + url='https://julialang-s3.julialang.org/bin/linux/ppc64le/1.10/julia-1.10.7-linux-ppc64le.tar.gz'; \ + sha256='6c8b3d4b05a5620efa68abc146c267e198dc0cd71a2c7bc02662fa0a424f679c'; \ + ;; \ + *) \ + echo >&2 "error: current architecture ($arch) does not have a corresponding Julia binary release"; \ + exit 1; \ + ;; \ + esac; \ + \ + curl -fL -o julia.tar.gz.asc "$url.asc"; \ + curl -fL -o julia.tar.gz "$url"; \ + \ + echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \ + \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ + \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# smoke test + julia --version + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["julia"] diff --git a/1.10/bookworm/docker-entrypoint.sh b/1.10/bookworm/docker-entrypoint.sh new file mode 100755 index 00000000..b3806f97 --- /dev/null +++ b/1.10/bookworm/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +# first arg is `-e` or `--some-option` (docker run julia -e '42') +# ... is a "*.jl" file (docker run -v ...:/my/file.jl:ro julia /my/file.jl) +# ... or there are no args +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ] || [ "${1%.jl}" != "$1" ]; then + exec julia "$@" +fi + +exec "$@" diff --git a/1.10/bullseye/Dockerfile b/1.10/bullseye/Dockerfile new file mode 100644 index 00000000..4ba38ba1 --- /dev/null +++ b/1.10/bullseye/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ +# ERROR: no download agent available; install curl, wget, or fetch + curl \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JULIA_PATH /usr/local/julia +ENV PATH $JULIA_PATH/bin:$PATH + +# https://julialang.org/juliareleases.asc +# Julia (Binary signing key) +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 + +# https://julialang.org/downloads/ +ENV JULIA_VERSION 1.10.7 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-1.10.7.sha256 + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + url='https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.7-linux-x86_64.tar.gz'; \ + sha256='21b2c69806aacf191d7c81806c7d9918bddab30c7b5b8d4251389c3abe274334'; \ + ;; \ + 'arm64') \ + url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.10/julia-1.10.7-linux-aarch64.tar.gz'; \ + sha256='93bf1b113f297c817310f77d1edce4ab9dcbf49432489cb8df09afbf93d1e5a0'; \ + ;; \ + 'i386') \ + url='https://julialang-s3.julialang.org/bin/linux/x86/1.10/julia-1.10.7-linux-i686.tar.gz'; \ + sha256='3e5afefd8a77d1e96b7037bfcd23def8f8993e3d0ca8408fffb292fa60a25cd0'; \ + ;; \ + 'ppc64el') \ + url='https://julialang-s3.julialang.org/bin/linux/ppc64le/1.10/julia-1.10.7-linux-ppc64le.tar.gz'; \ + sha256='6c8b3d4b05a5620efa68abc146c267e198dc0cd71a2c7bc02662fa0a424f679c'; \ + ;; \ + *) \ + echo >&2 "error: current architecture ($arch) does not have a corresponding Julia binary release"; \ + exit 1; \ + ;; \ + esac; \ + \ + curl -fL -o julia.tar.gz.asc "$url.asc"; \ + curl -fL -o julia.tar.gz "$url"; \ + \ + echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \ + \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ + \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# smoke test + julia --version + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["julia"] diff --git a/1.10/bullseye/docker-entrypoint.sh b/1.10/bullseye/docker-entrypoint.sh new file mode 100755 index 00000000..b3806f97 --- /dev/null +++ b/1.10/bullseye/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +# first arg is `-e` or `--some-option` (docker run julia -e '42') +# ... is a "*.jl" file (docker run -v ...:/my/file.jl:ro julia /my/file.jl) +# ... or there are no args +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ] || [ "${1%.jl}" != "$1" ]; then + exec julia "$@" +fi + +exec "$@" diff --git a/1.7-rc/windows/windowsservercore-1809/Dockerfile b/1.10/windows/windowsservercore-1809/Dockerfile similarity index 71% rename from 1.7-rc/windows/windowsservercore-1809/Dockerfile rename to 1.10/windows/windowsservercore-1809/Dockerfile index be979ea9..678b4367 100644 --- a/1.7-rc/windows/windowsservercore-1809/Dockerfile +++ b/1.10/windows/windowsservercore-1809/Dockerfile @@ -1,15 +1,21 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + FROM mcr.microsoft.com/windows/servercore:1809 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JULIA_VERSION 1.7.0-rc3 -ENV JULIA_SHA256 d48563b3faeeb0d937177f989f5c8bfe79552ac11255000870ce770a97c69de8 +ENV JULIA_VERSION 1.10.7 +ENV JULIA_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.10/julia-1.10.7-win64.exe +ENV JULIA_SHA256 51689d4e608fb78468ffabf55fd72896c3f3d84770cf58accb87cd0a57e9cbb8 -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ +RUN Write-Host ('Downloading {0} ...' -f $env:JULIA_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ + Invoke-WebRequest -Uri $env:JULIA_URL -OutFile 'julia.exe'; \ \ Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ @@ -25,6 +31,9 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 '/DIR=C:\julia' \ ); \ \ + Write-Host 'Removing ...'; \ + Remove-Item julia.exe -Force; \ + \ Write-Host 'Updating PATH ...'; \ $env:PATH = 'C:\julia\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ @@ -32,9 +41,6 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 Write-Host 'Verifying install ("julia --version") ...'; \ julia --version; \ \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ Write-Host 'Complete.' CMD ["julia"] diff --git a/1.7-rc/windows/windowsservercore-ltsc2022/Dockerfile b/1.10/windows/windowsservercore-ltsc2022/Dockerfile similarity index 71% rename from 1.7-rc/windows/windowsservercore-ltsc2022/Dockerfile rename to 1.10/windows/windowsservercore-ltsc2022/Dockerfile index 9108017f..0e070d79 100644 --- a/1.7-rc/windows/windowsservercore-ltsc2022/Dockerfile +++ b/1.10/windows/windowsservercore-ltsc2022/Dockerfile @@ -1,15 +1,21 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + FROM mcr.microsoft.com/windows/servercore:ltsc2022 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JULIA_VERSION 1.7.0-rc3 -ENV JULIA_SHA256 d48563b3faeeb0d937177f989f5c8bfe79552ac11255000870ce770a97c69de8 +ENV JULIA_VERSION 1.10.7 +ENV JULIA_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.10/julia-1.10.7-win64.exe +ENV JULIA_SHA256 51689d4e608fb78468ffabf55fd72896c3f3d84770cf58accb87cd0a57e9cbb8 -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ +RUN Write-Host ('Downloading {0} ...' -f $env:JULIA_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ + Invoke-WebRequest -Uri $env:JULIA_URL -OutFile 'julia.exe'; \ \ Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ @@ -25,6 +31,9 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 '/DIR=C:\julia' \ ); \ \ + Write-Host 'Removing ...'; \ + Remove-Item julia.exe -Force; \ + \ Write-Host 'Updating PATH ...'; \ $env:PATH = 'C:\julia\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ @@ -32,9 +41,6 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 Write-Host 'Verifying install ("julia --version") ...'; \ julia --version; \ \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ Write-Host 'Complete.' CMD ["julia"] diff --git a/1.11/alpine3.20/Dockerfile b/1.11/alpine3.20/Dockerfile new file mode 100644 index 00000000..7cd21433 --- /dev/null +++ b/1.11/alpine3.20/Dockerfile @@ -0,0 +1,59 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.20 + +ENV JULIA_PATH /usr/local/julia +ENV PATH $JULIA_PATH/bin:$PATH + +# https://julialang.org/juliareleases.asc +# Julia (Binary signing key) +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 + +# https://julialang.org/downloads/ +ENV JULIA_VERSION 1.11.2 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-1.11.2.sha256 + arch="$(apk --print-arch)"; \ + case "$arch" in \ + 'x86_64') \ + url='https://julialang-s3.julialang.org/bin/musl/x64/1.11/julia-1.11.2-musl-x86_64.tar.gz'; \ + sha256='dc7d2ec533c33f385683bad892d09c9f09f124061fa00ab7e4dd2e0912d55c19'; \ + ;; \ + *) \ + echo >&2 "error: current architecture ($arch) does not have a corresponding Julia binary release"; \ + exit 1; \ + ;; \ + esac; \ + \ + wget -O julia.tar.gz.asc "$url.asc"; \ + wget -O julia.tar.gz "$url"; \ + \ + echo "$sha256 *julia.tar.gz" | sha256sum -w -c -; \ + \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ + \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + julia --version + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["julia"] diff --git a/1.11/alpine3.20/docker-entrypoint.sh b/1.11/alpine3.20/docker-entrypoint.sh new file mode 100755 index 00000000..b3806f97 --- /dev/null +++ b/1.11/alpine3.20/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +# first arg is `-e` or `--some-option` (docker run julia -e '42') +# ... is a "*.jl" file (docker run -v ...:/my/file.jl:ro julia /my/file.jl) +# ... or there are no args +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ] || [ "${1%.jl}" != "$1" ]; then + exec julia "$@" +fi + +exec "$@" diff --git a/1.11/alpine3.21/Dockerfile b/1.11/alpine3.21/Dockerfile new file mode 100644 index 00000000..f92a52eb --- /dev/null +++ b/1.11/alpine3.21/Dockerfile @@ -0,0 +1,59 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 + +ENV JULIA_PATH /usr/local/julia +ENV PATH $JULIA_PATH/bin:$PATH + +# https://julialang.org/juliareleases.asc +# Julia (Binary signing key) +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 + +# https://julialang.org/downloads/ +ENV JULIA_VERSION 1.11.2 + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-1.11.2.sha256 + arch="$(apk --print-arch)"; \ + case "$arch" in \ + 'x86_64') \ + url='https://julialang-s3.julialang.org/bin/musl/x64/1.11/julia-1.11.2-musl-x86_64.tar.gz'; \ + sha256='dc7d2ec533c33f385683bad892d09c9f09f124061fa00ab7e4dd2e0912d55c19'; \ + ;; \ + *) \ + echo >&2 "error: current architecture ($arch) does not have a corresponding Julia binary release"; \ + exit 1; \ + ;; \ + esac; \ + \ + wget -O julia.tar.gz.asc "$url.asc"; \ + wget -O julia.tar.gz "$url"; \ + \ + echo "$sha256 *julia.tar.gz" | sha256sum -w -c -; \ + \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ + \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + julia --version + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["julia"] diff --git a/1.11/alpine3.21/docker-entrypoint.sh b/1.11/alpine3.21/docker-entrypoint.sh new file mode 100755 index 00000000..b3806f97 --- /dev/null +++ b/1.11/alpine3.21/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +# first arg is `-e` or `--some-option` (docker run julia -e '42') +# ... is a "*.jl" file (docker run -v ...:/my/file.jl:ro julia /my/file.jl) +# ... or there are no args +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ] || [ "${1%.jl}" != "$1" ]; then + exec julia "$@" +fi + +exec "$@" diff --git a/1.11/bookworm/Dockerfile b/1.11/bookworm/Dockerfile new file mode 100644 index 00000000..7fccb301 --- /dev/null +++ b/1.11/bookworm/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ +# ERROR: no download agent available; install curl, wget, or fetch + curl \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JULIA_PATH /usr/local/julia +ENV PATH $JULIA_PATH/bin:$PATH + +# https://julialang.org/juliareleases.asc +# Julia (Binary signing key) +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 + +# https://julialang.org/downloads/ +ENV JULIA_VERSION 1.11.2 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-1.11.2.sha256 + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + url='https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.2-linux-x86_64.tar.gz'; \ + sha256='8a372ad262d4d4d55a1044f4fe3bce7c9a4a3ce8c513d2470e58e8071eecd476'; \ + ;; \ + 'arm64') \ + url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.11/julia-1.11.2-linux-aarch64.tar.gz'; \ + sha256='0346e6d65852a3b73ced2c80c40f5a8cf38e7048d001cd57d3d1dd9efb2f6641'; \ + ;; \ + 'i386') \ + url='https://julialang-s3.julialang.org/bin/linux/x86/1.11/julia-1.11.2-linux-i686.tar.gz'; \ + sha256='a0b6e1e3a017c3db142f4c928006617870389d5f67c43adc4d0681b3bcd6c528'; \ + ;; \ + 'ppc64el') \ + url='https://julialang-s3.julialang.org/bin/linux/ppc64le/1.11/julia-1.11.2-linux-ppc64le.tar.gz'; \ + sha256='953829671af91de7002fffaec93ec8b40a063e84ad048a854f722f3cf4f76d18'; \ + ;; \ + *) \ + echo >&2 "error: current architecture ($arch) does not have a corresponding Julia binary release"; \ + exit 1; \ + ;; \ + esac; \ + \ + curl -fL -o julia.tar.gz.asc "$url.asc"; \ + curl -fL -o julia.tar.gz "$url"; \ + \ + echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \ + \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ + \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# smoke test + julia --version + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["julia"] diff --git a/1.11/bookworm/docker-entrypoint.sh b/1.11/bookworm/docker-entrypoint.sh new file mode 100755 index 00000000..b3806f97 --- /dev/null +++ b/1.11/bookworm/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +# first arg is `-e` or `--some-option` (docker run julia -e '42') +# ... is a "*.jl" file (docker run -v ...:/my/file.jl:ro julia /my/file.jl) +# ... or there are no args +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ] || [ "${1%.jl}" != "$1" ]; then + exec julia "$@" +fi + +exec "$@" diff --git a/1.11/bullseye/Dockerfile b/1.11/bullseye/Dockerfile new file mode 100644 index 00000000..f549a142 --- /dev/null +++ b/1.11/bullseye/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ +# ERROR: no download agent available; install curl, wget, or fetch + curl \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JULIA_PATH /usr/local/julia +ENV PATH $JULIA_PATH/bin:$PATH + +# https://julialang.org/juliareleases.asc +# Julia (Binary signing key) +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 + +# https://julialang.org/downloads/ +ENV JULIA_VERSION 1.11.2 + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-1.11.2.sha256 + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + url='https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.2-linux-x86_64.tar.gz'; \ + sha256='8a372ad262d4d4d55a1044f4fe3bce7c9a4a3ce8c513d2470e58e8071eecd476'; \ + ;; \ + 'arm64') \ + url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.11/julia-1.11.2-linux-aarch64.tar.gz'; \ + sha256='0346e6d65852a3b73ced2c80c40f5a8cf38e7048d001cd57d3d1dd9efb2f6641'; \ + ;; \ + 'i386') \ + url='https://julialang-s3.julialang.org/bin/linux/x86/1.11/julia-1.11.2-linux-i686.tar.gz'; \ + sha256='a0b6e1e3a017c3db142f4c928006617870389d5f67c43adc4d0681b3bcd6c528'; \ + ;; \ + 'ppc64el') \ + url='https://julialang-s3.julialang.org/bin/linux/ppc64le/1.11/julia-1.11.2-linux-ppc64le.tar.gz'; \ + sha256='953829671af91de7002fffaec93ec8b40a063e84ad048a854f722f3cf4f76d18'; \ + ;; \ + *) \ + echo >&2 "error: current architecture ($arch) does not have a corresponding Julia binary release"; \ + exit 1; \ + ;; \ + esac; \ + \ + curl -fL -o julia.tar.gz.asc "$url.asc"; \ + curl -fL -o julia.tar.gz "$url"; \ + \ + echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \ + \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ + \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# smoke test + julia --version + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["julia"] diff --git a/1.11/bullseye/docker-entrypoint.sh b/1.11/bullseye/docker-entrypoint.sh new file mode 100755 index 00000000..b3806f97 --- /dev/null +++ b/1.11/bullseye/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +# first arg is `-e` or `--some-option` (docker run julia -e '42') +# ... is a "*.jl" file (docker run -v ...:/my/file.jl:ro julia /my/file.jl) +# ... or there are no args +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ] || [ "${1%.jl}" != "$1" ]; then + exec julia "$@" +fi + +exec "$@" diff --git a/1.6/windows/windowsservercore-1809/Dockerfile b/1.11/windows/windowsservercore-1809/Dockerfile similarity index 71% rename from 1.6/windows/windowsservercore-1809/Dockerfile rename to 1.11/windows/windowsservercore-1809/Dockerfile index e1a5c58d..a9a5bf15 100644 --- a/1.6/windows/windowsservercore-1809/Dockerfile +++ b/1.11/windows/windowsservercore-1809/Dockerfile @@ -1,15 +1,21 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + FROM mcr.microsoft.com/windows/servercore:1809 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JULIA_VERSION 1.6.4 -ENV JULIA_SHA256 c9b6ecdad4feb57e5af12c9ef1a74993a96edbf87a4dc521d57e338397cee9b2 +ENV JULIA_VERSION 1.11.2 +ENV JULIA_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.11/julia-1.11.2-win64.exe +ENV JULIA_SHA256 617c6b4d5fadea5ed05cba649377ec7c0c83519da4249c247db5a7812dc6f0c1 -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ +RUN Write-Host ('Downloading {0} ...' -f $env:JULIA_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ + Invoke-WebRequest -Uri $env:JULIA_URL -OutFile 'julia.exe'; \ \ Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ @@ -25,6 +31,9 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 '/DIR=C:\julia' \ ); \ \ + Write-Host 'Removing ...'; \ + Remove-Item julia.exe -Force; \ + \ Write-Host 'Updating PATH ...'; \ $env:PATH = 'C:\julia\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ @@ -32,9 +41,6 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 Write-Host 'Verifying install ("julia --version") ...'; \ julia --version; \ \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ Write-Host 'Complete.' CMD ["julia"] diff --git a/1.6/windows/windowsservercore-ltsc2022/Dockerfile b/1.11/windows/windowsservercore-ltsc2022/Dockerfile similarity index 71% rename from 1.6/windows/windowsservercore-ltsc2022/Dockerfile rename to 1.11/windows/windowsservercore-ltsc2022/Dockerfile index 3f9c483b..1c0ee537 100644 --- a/1.6/windows/windowsservercore-ltsc2022/Dockerfile +++ b/1.11/windows/windowsservercore-ltsc2022/Dockerfile @@ -1,15 +1,21 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + FROM mcr.microsoft.com/windows/servercore:ltsc2022 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JULIA_VERSION 1.6.4 -ENV JULIA_SHA256 c9b6ecdad4feb57e5af12c9ef1a74993a96edbf87a4dc521d57e338397cee9b2 +ENV JULIA_VERSION 1.11.2 +ENV JULIA_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.11/julia-1.11.2-win64.exe +ENV JULIA_SHA256 617c6b4d5fadea5ed05cba649377ec7c0c83519da4249c247db5a7812dc6f0c1 -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ +RUN Write-Host ('Downloading {0} ...' -f $env:JULIA_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ + Invoke-WebRequest -Uri $env:JULIA_URL -OutFile 'julia.exe'; \ \ Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ @@ -25,6 +31,9 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 '/DIR=C:\julia' \ ); \ \ + Write-Host 'Removing ...'; \ + Remove-Item julia.exe -Force; \ + \ Write-Host 'Updating PATH ...'; \ $env:PATH = 'C:\julia\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ @@ -32,9 +41,6 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 Write-Host 'Verifying install ("julia --version") ...'; \ julia --version; \ \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ Write-Host 'Complete.' CMD ["julia"] diff --git a/1.6/alpine3.14/Dockerfile b/1.6/alpine3.14/Dockerfile deleted file mode 100644 index 1c29ff2b..00000000 --- a/1.6/alpine3.14/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM alpine:3.14 - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.6.4 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.6.4.sha256 -# this "case" statement is generated via "update.sh" - apkArch="$(apk --print-arch)"; \ - case "$apkArch" in \ -# amd64 - x86_64) tarArch='x86_64'; dirArch='x64'; sha256='63f121dffa982ff9b53c7c8a334830e17e2c9d2efa79316a548d29f7f8925e66' ;; \ - *) echo >&2 "error: current architecture ($apkArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - wget -O julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz.asc"; \ - wget -O julia.tar.gz "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apk del --no-network .fetch-deps; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.6/alpine3.15/Dockerfile b/1.6/alpine3.15/Dockerfile deleted file mode 100644 index 5790c79d..00000000 --- a/1.6/alpine3.15/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM alpine:3.15 - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.6.4 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.6.4.sha256 -# this "case" statement is generated via "update.sh" - apkArch="$(apk --print-arch)"; \ - case "$apkArch" in \ -# amd64 - x86_64) tarArch='x86_64'; dirArch='x64'; sha256='63f121dffa982ff9b53c7c8a334830e17e2c9d2efa79316a548d29f7f8925e66' ;; \ - *) echo >&2 "error: current architecture ($apkArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - wget -O julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz.asc"; \ - wget -O julia.tar.gz "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apk del --no-network .fetch-deps; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.6/bullseye/Dockerfile b/1.6/bullseye/Dockerfile deleted file mode 100644 index 3a5d1751..00000000 --- a/1.6/bullseye/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM debian:bullseye-slim - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ -# ERROR: no download agent available; install curl, wget, or fetch - curl \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.6.4 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - if ! command -v gpg > /dev/null; then \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gnupg \ - dirmngr \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.6.4.sha256 -# this "case" statement is generated via "update.sh" - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ -# amd64 - amd64) tarArch='x86_64'; dirArch='x64'; sha256='52244ae47697e8073dfbc9d1251b0422f0dbd1fbe1a41da4b9f7ddf0506b2132' ;; \ -# arm32v7 - armhf) tarArch='armv7l'; dirArch='armv7l'; sha256='9ad3f6bd71eb6840d4cef1569855da20c0b4931a2bdf77703a64df672b0702a1' ;; \ -# arm64v8 - arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='072daac7229c15fa41d0c1b65b8a3d6ee747323d02f5943da3846b075291b48b' ;; \ -# i386 - i386) tarArch='i686'; dirArch='x86'; sha256='9d43d642174cf22cf0fde18dc2578c84f357d2c619b9d846d3a6da4192ba48cf' ;; \ - *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ - curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.6/buster/Dockerfile b/1.6/buster/Dockerfile deleted file mode 100644 index 8efb8aa2..00000000 --- a/1.6/buster/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM debian:buster-slim - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ -# ERROR: no download agent available; install curl, wget, or fetch - curl \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.6.4 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - if ! command -v gpg > /dev/null; then \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gnupg \ - dirmngr \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.6.4.sha256 -# this "case" statement is generated via "update.sh" - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ -# amd64 - amd64) tarArch='x86_64'; dirArch='x64'; sha256='52244ae47697e8073dfbc9d1251b0422f0dbd1fbe1a41da4b9f7ddf0506b2132' ;; \ -# arm32v7 - armhf) tarArch='armv7l'; dirArch='armv7l'; sha256='9ad3f6bd71eb6840d4cef1569855da20c0b4931a2bdf77703a64df672b0702a1' ;; \ -# arm64v8 - arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='072daac7229c15fa41d0c1b65b8a3d6ee747323d02f5943da3846b075291b48b' ;; \ -# i386 - i386) tarArch='i686'; dirArch='x86'; sha256='9d43d642174cf22cf0fde18dc2578c84f357d2c619b9d846d3a6da4192ba48cf' ;; \ - *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ - curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.6/windows/windowsservercore-ltsc2016/Dockerfile b/1.6/windows/windowsservercore-ltsc2016/Dockerfile deleted file mode 100644 index 2cb1e68d..00000000 --- a/1.6/windows/windowsservercore-ltsc2016/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2016 - -# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ENV JULIA_VERSION 1.6.4 -ENV JULIA_SHA256 c9b6ecdad4feb57e5af12c9ef1a74993a96edbf87a4dc521d57e338397cee9b2 - -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ - \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ - if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ - Write-Host 'Installing ...'; \ - Start-Process -Wait -NoNewWindow \ - -FilePath '.\julia.exe' \ - -ArgumentList @( \ - '/SILENT', \ - '/DIR=C:\julia' \ - ); \ - \ - Write-Host 'Updating PATH ...'; \ - $env:PATH = 'C:\julia\bin;' + $env:PATH; \ - [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ("julia --version") ...'; \ - julia --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ - Write-Host 'Complete.' - -CMD ["julia"] diff --git a/1.7-rc/alpine3.14/Dockerfile b/1.7-rc/alpine3.14/Dockerfile deleted file mode 100644 index d411da7a..00000000 --- a/1.7-rc/alpine3.14/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM alpine:3.14 - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.7.0-rc3 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.7.0-rc3.sha256 -# this "case" statement is generated via "update.sh" - apkArch="$(apk --print-arch)"; \ - case "$apkArch" in \ -# amd64 - x86_64) tarArch='x86_64'; dirArch='x64'; sha256='68dc3d7b17fbcceea383b48d82c63c36b899e05f5cd7537a730d7578f65c40ea' ;; \ - *) echo >&2 "error: current architecture ($apkArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - wget -O julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz.asc"; \ - wget -O julia.tar.gz "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apk del --no-network .fetch-deps; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.7-rc/alpine3.15/Dockerfile b/1.7-rc/alpine3.15/Dockerfile deleted file mode 100644 index cce200f0..00000000 --- a/1.7-rc/alpine3.15/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM alpine:3.15 - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.7.0-rc3 - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.7.0-rc3.sha256 -# this "case" statement is generated via "update.sh" - apkArch="$(apk --print-arch)"; \ - case "$apkArch" in \ -# amd64 - x86_64) tarArch='x86_64'; dirArch='x64'; sha256='68dc3d7b17fbcceea383b48d82c63c36b899e05f5cd7537a730d7578f65c40ea' ;; \ - *) echo >&2 "error: current architecture ($apkArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - wget -O julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz.asc"; \ - wget -O julia.tar.gz "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apk del --no-network .fetch-deps; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.7-rc/bullseye/Dockerfile b/1.7-rc/bullseye/Dockerfile deleted file mode 100644 index be519aba..00000000 --- a/1.7-rc/bullseye/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM debian:bullseye-slim - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ -# ERROR: no download agent available; install curl, wget, or fetch - curl \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.7.0-rc3 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - if ! command -v gpg > /dev/null; then \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gnupg \ - dirmngr \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.7.0-rc3.sha256 -# this "case" statement is generated via "update.sh" - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ -# amd64 - amd64) tarArch='x86_64'; dirArch='x64'; sha256='cbf33c533d6f226161f08cdc3cec16745a3dc5afdfbaece95e3f2a5e0b6b7886' ;; \ -# arm32v7 - armhf) tarArch='armv7l'; dirArch='armv7l'; sha256='fff9370f58fd8f94f12a14d38c32d25b9e493d62a6d992edfc378caf9ef8d1cc' ;; \ -# arm64v8 - arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='0662f9f31c87559ec33a24b3b83df85071357708287678ca78c7fa4498d05e5c' ;; \ -# i386 - i386) tarArch='i686'; dirArch='x86'; sha256='9ee7692faee05d7dbe431c59850542d95d260368bbf6d4f0ccdd03be07fef817' ;; \ - *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ - curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.7-rc/buster/Dockerfile b/1.7-rc/buster/Dockerfile deleted file mode 100644 index a8e58deb..00000000 --- a/1.7-rc/buster/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM debian:buster-slim - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ -# ERROR: no download agent available; install curl, wget, or fetch - curl \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION 1.7.0-rc3 - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - if ! command -v gpg > /dev/null; then \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gnupg \ - dirmngr \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-1.7.0-rc3.sha256 -# this "case" statement is generated via "update.sh" - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ -# amd64 - amd64) tarArch='x86_64'; dirArch='x64'; sha256='cbf33c533d6f226161f08cdc3cec16745a3dc5afdfbaece95e3f2a5e0b6b7886' ;; \ -# arm32v7 - armhf) tarArch='armv7l'; dirArch='armv7l'; sha256='fff9370f58fd8f94f12a14d38c32d25b9e493d62a6d992edfc378caf9ef8d1cc' ;; \ -# arm64v8 - arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='0662f9f31c87559ec33a24b3b83df85071357708287678ca78c7fa4498d05e5c' ;; \ -# i386 - i386) tarArch='i686'; dirArch='x86'; sha256='9ee7692faee05d7dbe431c59850542d95d260368bbf6d4f0ccdd03be07fef817' ;; \ - *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ - esac; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ - curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/1.7-rc/windows/windowsservercore-ltsc2016/Dockerfile b/1.7-rc/windows/windowsservercore-ltsc2016/Dockerfile deleted file mode 100644 index 0a32c8d7..00000000 --- a/1.7-rc/windows/windowsservercore-ltsc2016/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2016 - -# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ENV JULIA_VERSION 1.7.0-rc3 -ENV JULIA_SHA256 d48563b3faeeb0d937177f989f5c8bfe79552ac11255000870ce770a97c69de8 - -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ - \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ - if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - \ - Write-Host 'Installing ...'; \ - Start-Process -Wait -NoNewWindow \ - -FilePath '.\julia.exe' \ - -ArgumentList @( \ - '/SILENT', \ - '/DIR=C:\julia' \ - ); \ - \ - Write-Host 'Updating PATH ...'; \ - $env:PATH = 'C:\julia\bin;' + $env:PATH; \ - [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ - \ - Write-Host 'Verifying install ("julia --version") ...'; \ - julia --version; \ - \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ - Write-Host 'Complete.' - -CMD ["julia"] diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template deleted file mode 100644 index f102cc42..00000000 --- a/Dockerfile-alpine.template +++ /dev/null @@ -1,43 +0,0 @@ -FROM alpine:%%TAG%% - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION %%JULIA_VERSION%% - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-%%JULIA_VERSION%%.sha256 -# this "case" statement is generated via "update.sh" - %%ARCH-CASE%%; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - wget -O julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz.asc"; \ - wget -O julia.tar.gz "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-musl-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apk del --no-network .fetch-deps; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template deleted file mode 100644 index 0a691755..00000000 --- a/Dockerfile-debian.template +++ /dev/null @@ -1,62 +0,0 @@ -FROM debian:%%TAG%% - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ -# ERROR: no download agent available; install curl, wget, or fetch - curl \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV JULIA_PATH /usr/local/julia -ENV PATH $JULIA_PATH/bin:$PATH - -# https://julialang.org/juliareleases.asc -# Julia (Binary signing key) -ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 - -# https://julialang.org/downloads/ -ENV JULIA_VERSION %%JULIA_VERSION%% - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - if ! command -v gpg > /dev/null; then \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gnupg \ - dirmngr \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ - \ -# https://julialang.org/downloads/#julia-command-line-version -# https://julialang-s3.julialang.org/bin/checksums/julia-%%JULIA_VERSION%%.sha256 -# this "case" statement is generated via "update.sh" - %%ARCH-CASE%%; \ - \ - folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ - curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ - curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ - \ - echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ - gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ - \ - mkdir "$JULIA_PATH"; \ - tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ - rm julia.tar.gz; \ - \ - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# smoke test - julia --version - -CMD ["julia"] diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template new file mode 100644 index 00000000..cd38530d --- /dev/null +++ b/Dockerfile-linux.template @@ -0,0 +1,128 @@ +{{ + def is_alpine: + env.variant | startswith("alpine") + ; + def os_arches: + if is_alpine then + { + amd64: "x86_64", + arm32v6: "armhf", + arm32v7: "armv7", + arm64v8: "aarch64", + i386: "x86", + ppc64le: "ppc64le", + s390x: "s390x", + } + else + { + amd64: "amd64", + arm32v5: "armel", + arm32v7: "armhf", + arm64v8: "arm64", + i386: "i386", + mips64le: "mips64el", + ppc64le: "ppc64el", + s390x: "s390x", + } + end +-}} +{{ if is_alpine then ( -}} +FROM alpine:{{ env.variant | ltrimstr("alpine") }} +{{ ) else ( -}} +FROM debian:{{ env.variant }}-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ +# ERROR: no download agent available; install curl, wget, or fetch + curl \ + ; \ + rm -rf /var/lib/apt/lists/* +{{ ) end -}} + +ENV JULIA_PATH /usr/local/julia +ENV PATH $JULIA_PATH/bin:$PATH + +# https://julialang.org/juliareleases.asc +# Julia (Binary signing key) +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 + +# https://julialang.org/downloads/ +ENV JULIA_VERSION {{ .version }} + +RUN set -eux; \ + \ +{{ if is_alpine then ( -}} + apk add --no-cache --virtual .fetch-deps gnupg; \ +{{ ) else ( -}} + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ +{{ ) end -}} + \ +# https://julialang.org/downloads/#julia-command-line-version +# https://julialang-s3.julialang.org/bin/checksums/julia-{{ .version }}.sha256 +{{ if is_alpine then ( -}} + arch="$(apk --print-arch)"; \ +{{ ) else ( -}} + arch="$(dpkg --print-architecture)"; \ +{{ ) end -}} + case "$arch" in \ +{{ + [ + .arches + | to_entries[] + | select(.key | if is_alpine then startswith("alpine-") else contains("-") | not end) + | (.key | ltrimstr("alpine-")) as $bashbrewArch + | (os_arches[$bashbrewArch] // empty) as $osArch + | .value + | ( +-}} + {{ $osArch | @sh }}) \ + url={{ .url | @sh }}; \ + sha256={{ .sha256 | @sh }}; \ + ;; \ +{{ + ) + ] | add +-}} + *) \ + echo >&2 "error: current architecture ($arch) does not have a corresponding Julia binary release"; \ + exit 1; \ + ;; \ + esac; \ + \ +{{ def wget: if is_alpine then "wget -O" else "curl -fL -o" end -}} + {{ wget }} julia.tar.gz.asc "$url.asc"; \ + {{ wget }} julia.tar.gz "$url"; \ + \ + echo "$sha256 *julia.tar.gz" | sha256sum {{ if is_alpine then "-w -c" else "--strict --check" end }} -; \ + \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \ + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ + \ + mkdir "$JULIA_PATH"; \ + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ + rm julia.tar.gz; \ + \ +{{ if is_alpine then ( -}} + apk del --no-network .fetch-deps; \ +{{ ) else ( -}} + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ +{{ ) end -}} + \ +# smoke test + julia --version + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["julia"] diff --git a/Dockerfile-windowsservercore.template b/Dockerfile-windows-servercore.template similarity index 72% rename from Dockerfile-windowsservercore.template rename to Dockerfile-windows-servercore.template index 1ed8fd4c..066a76b3 100644 --- a/Dockerfile-windowsservercore.template +++ b/Dockerfile-windows-servercore.template @@ -1,15 +1,15 @@ -FROM mcr.microsoft.com/windows/servercore:%%TAG%% +FROM mcr.microsoft.com/windows/{{ env.windowsVariant }}:{{ env.windowsRelease }} # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JULIA_VERSION %%JULIA_VERSION%% -ENV JULIA_SHA256 %%JULIA_WINDOWS_SHA256%% +ENV JULIA_VERSION {{ .version }} +ENV JULIA_URL {{ .arches["windows-amd64"].url }} +ENV JULIA_SHA256 {{ .arches["windows-amd64"].sha256 }} -RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win64.exe' -f $env:JULIA_VERSION, ($env:JULIA_VERSION.Split('.')[0..1] -Join '.')); \ - Write-Host ('Downloading {0} ...' -f $url); \ +RUN Write-Host ('Downloading {0} ...' -f $env:JULIA_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri $url -OutFile 'julia.exe'; \ + Invoke-WebRequest -Uri $env:JULIA_URL -OutFile 'julia.exe'; \ \ Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \ if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \ @@ -25,6 +25,9 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 '/DIR=C:\julia' \ ); \ \ + Write-Host 'Removing ...'; \ + Remove-Item julia.exe -Force; \ + \ Write-Host 'Updating PATH ...'; \ $env:PATH = 'C:\julia\bin;' + $env:PATH; \ [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ @@ -32,9 +35,6 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6 Write-Host 'Verifying install ("julia --version") ...'; \ julia --version; \ \ - Write-Host 'Removing ...'; \ - Remove-Item julia.exe -Force; \ - \ Write-Host 'Complete.' CMD ["julia"] diff --git a/README.md b/README.md index f749a4e8..f8442835 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,4 @@ For more information about the full official images change lifecycle, see [the " For outstanding `julia` image PRs, check [PRs with the "library/julia" label on the official-images repository](https://github.com/docker-library/official-images/labels/library%2Fjulia). For the current "source of truth" for [`julia`](https://hub.docker.com/_/julia/), see [the `library/julia` file in the official-images repository](https://github.com/docker-library/official-images/blob/master/library/julia). ---- - -- [![build status badge](https://img.shields.io/github/workflow/status/docker-library/julia/GitHub%20CI/master?label=GitHub%20CI)](https://github.com/docker-library/julia/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amaster) -- [![build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/julia.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/julia/) - -| Build | Status | Badges | (per-arch) | -|:-:|:-:|:-:|:-:| -| [![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/julia.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/julia/) | [![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/julia.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/julia/) | [![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/julia.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/julia/) | [![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/julia.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/julia/) | -| [![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/julia.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/julia/) | [![windows-amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/windows-amd64/job/julia.svg?label=windows-amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/windows-amd64/job/julia/) | [![put-shared build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/put-shared/job/light/job/julia.svg?label=put-shared)](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/julia/) | - diff --git a/apply-templates.sh b/apply-templates.sh new file mode 100755 index 00000000..3f5eb3e5 --- /dev/null +++ b/apply-templates.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +[ -f versions.json ] # run "versions.sh" first + +jqt='.jq-template.awk' +if [ -n "${BASHBREW_SCRIPTS:-}" ]; then + jqt="$BASHBREW_SCRIPTS/jq-template.awk" +elif [ "$BASH_SOURCE" -nt "$jqt" ]; then + # https://github.com/docker-library/bashbrew/blob/master/scripts/jq-template.awk + wget -qO "$jqt" 'https://github.com/docker-library/bashbrew/raw/9f6a35772ac863a0241f147c820354e4008edf38/scripts/jq-template.awk' +fi + +if [ "$#" -eq 0 ]; then + versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)" + eval "set -- $versions" +fi + +generated_warning() { + cat <<-EOH + # + # NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" + # + # PLEASE DO NOT EDIT IT DIRECTLY. + # + + EOH +} + +for version; do + export version + + rm -rf "$version/" + + if jq -e '.[env.version] | not' versions.json > /dev/null; then + echo "deleting $version ..." + continue + fi + + variants="$(jq -r '.[env.version].variants | map(@sh) | join(" ")' versions.json)" + eval "variants=( $variants )" + + for dir in "${variants[@]}"; do + mkdir -p "$version/$dir" + + variant="$(basename "$dir")" # "bookworm", "windowsservercore-1809", etc + export variant + + case "$dir" in + windows/*) + windowsVariant="${variant%%-*}" # "windowsservercore", "nanoserver" + windowsRelease="${variant#$windowsVariant-}" # "ltsc2022", "1809", etc + windowsVariant="${windowsVariant#windows}" # "servercore", "nanoserver" + export windowsVariant windowsRelease + template="Dockerfile-windows-$windowsVariant.template" + ;; + + *) + template='Dockerfile-linux.template' + cp -a docker-entrypoint.sh "$version/$dir/" + ;; + esac + + echo "processing $version/$dir ..." + + { + generated_warning + gawk -f "$jqt" "$template" + } > "$version/$dir/Dockerfile" + done +done diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 00000000..b3806f97 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu + +# first arg is `-e` or `--some-option` (docker run julia -e '42') +# ... is a "*.jl" file (docker run -v ...:/my/file.jl:ro julia /my/file.jl) +# ... or there are no args +if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ] || [ "${1%.jl}" != "$1" ]; then + exec julia "$@" +fi + +exec "$@" diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index d9039a3d..10d56208 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -1,20 +1,16 @@ #!/usr/bin/env bash set -Eeuo pipefail -declare -A aliases=( - [1.6]='1 latest' -) -defaultDebianVariant='bullseye' -defaultAlpineVariant='alpine3.15' - self="$(basename "$BASH_SOURCE")" cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" -versions=( */ ) -versions=( "${versions[@]%/}" ) +if [ "$#" -eq 0 ]; then + versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)" + eval "set -- $versions" +fi # sort version numbers with highest first -IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -rV) ); unset IFS +IFS=$'\n'; set -- $(sort -rV <<<"$*"); unset IFS # get the most recent commit which modified any of "$@" fileCommit() { @@ -26,52 +22,40 @@ dirCommit() { local dir="$1"; shift ( cd "$dir" - fileCommit \ - Dockerfile \ - $(git show HEAD:./Dockerfile | awk ' + files="$( + git show HEAD:./Dockerfile | awk ' toupper($1) == "COPY" { for (i = 2; i < NF; i++) { + if ($i ~ /^--from=/) { + next + } print $i } } - ') + ' + )" + fileCommit Dockerfile $files ) } getArches() { local repo="$1"; shift - local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' + local officialImagesBase="${BASHBREW_LIBRARY:-https://github.com/docker-library/official-images/raw/HEAD/library}/" - eval "declare -g -A parentRepoToArches=( $( - find -name 'Dockerfile' -exec awk ' + local parentRepoToArchesStr + parentRepoToArchesStr="$( + find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" ' toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ { - print "'"$officialImagesUrl"'" $2 + printf "%s%s\n", officialImagesBase, $2 } ' '{}' + \ | sort -u \ - | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' - ) )" + | xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"' + )" + eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )" } getArches 'julia' -source '.architectures-lib' - -parentArches() { - local version="$1"; shift # "1.8", etc - local dir="$1"; shift # "1.8/windows/windowsservercore-ltsc2016" - - local parent="$(awk 'toupper($1) == "FROM" { print $2 }' "$dir/Dockerfile")" - local parentArches="${parentRepoToArches[$parent]:-}" - - local arches=() - for arch in $parentArches; do - if hasBashbrewArch "$version" "$arch" && grep -qE "^# $arch\$" "$dir/Dockerfile"; then - arches+=( "$arch" ) - fi - done - echo "${arches[*]}" -} - cat <<-EOH # this file is generated via https://github.com/docker-library/julia/blob/$(fileCommit "$self")/$self @@ -87,46 +71,120 @@ join() { echo "${out#$sep}" } -for version in "${versions[@]}"; do - for v in \ - {bullseye,buster} \ - alpine{3.15,3.14} \ - windows/windowsservercore-{ltsc2022,1809,ltsc2016} \ - ; do - dir="$version/$v" - dir="${dir#./}" - variant="$(basename "$v")" +declare -A latest=( + #[1]='1.9' + #[latest]='1.9' + #[rc]='1.10-rc' +) - [ -f "$dir/Dockerfile" ] || continue +for version; do + export version - commit="$(dirCommit "$dir")" + if ! fullVersion="$(jq -er '.[env.version] | if . then .version else empty end' versions.json)"; then + continue + fi - fullVersion="$(git show "$commit":"$dir/Dockerfile" | awk '$1 == "ENV" && $2 == "JULIA_VERSION" { print $3; exit }')" + variants="$(jq -r '.[env.version].variants | map(@sh) | join(" ")' versions.json)" + eval "variants=( $variants )" - versionAliases=() - while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do - versionAliases+=( $fullVersion ) - fullVersion="${fullVersion%[.-]*}" - done - versionAliases+=( - $version - ${aliases[$version]:-} - ) + versionAliases=( + $fullVersion + $version + ) - variantAliases=( "${versionAliases[@]/%/-$variant}" ) - if [ "$variant" = "$defaultAlpineVariant" ]; then - variantAliases+=( "${versionAliases[@]/%/-alpine}" ) + aliases=() + if [ "$version" = "${version%-rc}" ]; then + if [[ "$version" =~ [0-9]+[.][0-9]+ ]]; then + aliases+=( "${version%%.*}" latest ) # "1", "latest" fi - variantAliases=( "${variantAliases[@]//latest-/}" ) + else + aliases+=( rc ) + fi + for a in "${aliases[@]}"; do + if [ -z "${latest[$a]:-}" ]; then + latest[$a]="$version" + versionAliases+=( "$a" ) + fi + done + + defaultDebianVariant="$(jq -r ' + .[env.version].variants + | map(select( + startswith("alpine") + or startswith("windows/") + | not + )) + | .[0] + ' versions.json)" + defaultAlpineVariant="$(jq -r ' + .[env.version].variants + | map(select( + startswith("alpine") + )) + | .[0] + ' versions.json)" + + for v in "${variants[@]}"; do + dir="$version/$v" + [ -f "$dir/Dockerfile" ] || continue + variant="$(basename "$v")" + export variant + commit="$(dirCommit "$dir")" + + variantAliases=( "${versionAliases[@]/%/-$variant}" ) sharedTags=() - if [ "$variant" = "$defaultDebianVariant" ] || [[ "$variant" == 'windowsservercore'* ]]; then - sharedTags+=( "${versionAliases[@]}" ) - fi + case "$variant" in + "$defaultDebianVariant" | windowsservercore-*) + sharedTags=( "${versionAliases[@]}" ) + ;; + "$defaultAlpineVariant") + variantAliases+=( "${versionAliases[@]/%/-alpine}" ) + ;; + esac + variantAliases=( "${variantAliases[@]//latest-/}" ) + + for windowsShared in windowsservercore nanoserver; do + if [[ "$variant" == "$windowsShared"* ]]; then + sharedTags+=( "${versionAliases[@]/%/-$windowsShared}" ) + sharedTags=( "${sharedTags[@]//latest-/}" ) + break + fi + done + constraints= case "$v" in - windows/*) variantArches='windows-amd64' ;; - *) variantArches="$(parentArches "$version" "$dir")" ;; + windows/*) + variantArches="$(jq -r ' + .[env.version].arches + | keys[] + | select(startswith("windows-")) + | select(. != "windows-i386") # TODO "windows-arm64v8" someday? 👀 + ' versions.json | sort)" + constraints="$variant" + ;; + + *) + variantParent="$(awk 'toupper($1) == "FROM" { print $2; exit }' "$dir/Dockerfile")" + variantArches="${parentRepoToArches[$variantParent]:-}" + variantArches="$( + comm -12 \ + <( + jq -r ' + .[env.version].arches + | keys[] + | if env.variant | startswith("alpine") then + if startswith("alpine-") then + ltrimstr("alpine-") + else + empty + end + else . end + ' versions.json | sort + ) \ + <(xargs -n1 <<<"$variantArches" | sort) + )" + ;; esac echo @@ -139,6 +197,9 @@ for version in "${versions[@]}"; do GitCommit: $commit Directory: $dir EOE - [[ "$v" == windows/* ]] && echo "Constraints: $variant" + [ -z "$constraints" ] || { + echo "Constraints: $constraints"; + echo 'Builder: classic' # no Windows support in BuildKit (yet) + } done done diff --git a/release-architectures b/release-architectures deleted file mode 100644 index 87752078..00000000 --- a/release-architectures +++ /dev/null @@ -1,8 +0,0 @@ -# see https://julialang.org/downloads/#julia-command-line-version - -# bashbrew-arch dpkg-arch julia-tar-arch julia-dir-arch -amd64 amd64 x86_64 x64 -arm32v7 armhf armv7l armv7l -arm64v8 arm64 aarch64 aarch64 -i386 i386 i686 x86 -ppc64le ppc64el ppc64le ppc64le diff --git a/update.sh b/update.sh index 29d839d9..bac2d758 100755 --- a/update.sh +++ b/update.sh @@ -1,120 +1,7 @@ #!/usr/bin/env bash set -Eeuo pipefail -# TODO https://julialang-s3.julialang.org/bin/versions.json ? -# delayed deploys: https://github.com/JuliaLang/julia/issues/38946#issuecomment-749224376 - cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" -versions=( "$@" ) -if [ ${#versions[@]} -eq 0 ]; then - versions=( */ ) -fi -versions=( "${versions[@]%/}" ) - -source '.architectures-lib' - -# see https://stackoverflow.com/a/2705678/433558 -sed_escape_rhs() { - echo "$@" | sed -e 's/[\/&]/\\&/g' | sed -e ':a;N;$!ba;s/\n/\\n/g' -} - -rcRegex='-(pre[.])?(alpha|beta|rc)[0-9]*' - -pattern='[^"]*/julia-([0-9]+\.[0-9]+\.[0-9]+('"$rcRegex"')?)-linux-x86_64\.tar\.gz[^"]*' -allVersions="$( - curl -fsSL 'https://julialang.org/downloads/' \ - | grep -oE "$pattern" \ - | sed -rn "s!${pattern}!\1!gp" \ - | sort -ruV -)" - -for version in "${versions[@]}"; do - rcVersion="${version%-rc}" - rcGrepV='-v' - if [ "$rcVersion" != "$version" ]; then - rcGrepV= - fi - rcGrepV+=' -E' - - fullVersion="$(grep -E "^${rcVersion}([.-]|$)" <<<"$allVersions" | grep $rcGrepV -- "$rcRegex" | head -1)" - if [ -z "$fullVersion" ]; then - echo >&2 "error: failed to determine latest release for '$version'" - exit 1 - fi - - sha256s="$(curl -fsSL "https://julialang-s3.julialang.org/bin/checksums/julia-${fullVersion}.sha256")" - - linuxArchCase='dpkgArch="$(dpkg --print-architecture)"; '$'\\\n' - linuxArchCase+=$'\t''case "${dpkgArch##*-}" in '$'\\\n' - for dpkgArch in $(dpkgArches "$version"); do - tarArch="$(dpkgToJuliaTarArch "$version" "$dpkgArch")" - dirArch="$(dpkgToJuliaDirArch "$version" "$dpkgArch")" - sha256="$(grep "julia-${fullVersion}-linux-${tarArch}.tar.gz$" <<<"$sha256s" | cut -d' ' -f1 || :)" - if [ -z "$sha256" ]; then - echo >&2 "warning: cannot find sha256 for $fullVersion on arch $tarArch / $dirArch ($dpkgArch); skipping" - continue - fi - bashbrewArch="$(dpkgToBashbrewArch "$version" "$dpkgArch")" - linuxArchCase+="# $bashbrewArch"$'\n' - linuxArchCase+=$'\t\t'"$dpkgArch) tarArch='$tarArch'; dirArch='$dirArch'; sha256='$sha256' ;; "$'\\\n' - done - linuxArchCase+=$'\t\t''*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; '$'\\\n' - linuxArchCase+=$'\t''esac' - - winSha256="$(grep "julia-${fullVersion}-win64.exe$" <<<"$sha256s" | cut -d' ' -f1)" - - echo "$version: $fullVersion" - - for v in \ - windows/windowsservercore-{ltsc2022,1809,ltsc2016} \ - alpine{3.15,3.14} \ - {bullseye,buster} \ - ; do - dir="$version/$v" - variant="$(basename "$v")" - - [ -d "$dir" ] || continue - - case "$variant" in - windowsservercore-*) template='windowsservercore'; tag="${variant#*-}" ;; - alpine*) template='alpine'; tag="${variant#alpine}" ;; - *) template='debian'; tag="${variant}-slim" ;; - esac - - variantArchCase="$linuxArchCase" - if [ "$template" = 'alpine' ]; then - sha256="$(grep "julia-${fullVersion}-musl-x86_64.tar.gz$" <<<"$sha256s" | cut -d' ' -f1 || :)" - if [ -z "$sha256" ]; then - echo >&2 "error: missing musl build for $fullVersion ($version)!" - exit 1 - fi - variantArchCase='apkArch="$(apk --print-arch)"; '$'\\\n' - variantArchCase+=$'\t''case "$apkArch" in '$'\\\n' - # TODO Alpine multiarch - variantArchCase+='# amd64'$'\n' - tarArch="$(dpkgToJuliaTarArch "$version" 'amd64')" - dirArch="$(dpkgToJuliaDirArch "$version" 'amd64')" - variantArchCase+=$'\t\t'"x86_64) tarArch='$tarArch'; dirArch='$dirArch'; sha256='$sha256' ;; "$'\\\n' - variantArchCase+=$'\t\t''*) echo >&2 "error: current architecture ($apkArch) does not have a corresponding Julia binary release"; exit 1 ;; '$'\\\n' - variantArchCase+=$'\t''esac' - fi - - sed -r \ - -e 's!%%JULIA_VERSION%%!'"$fullVersion"'!g' \ - -e 's!%%TAG%%!'"$tag"'!g' \ - -e 's!%%JULIA_WINDOWS_SHA256%%!'"$winSha256"'!g' \ - -e 's!%%ARCH-CASE%%!'"$(sed_escape_rhs "$variantArchCase")"'!g' \ - "Dockerfile-$template.template" > "$dir/Dockerfile" - - case "$dir" in - 1.0/windows/*) - # https://github.com/JuliaLang/julia/blob/v1.4.0-rc1/NEWS.md#build-system-changes - sed -ri \ - -e 's!/SILENT!/S!g' \ - -e 's!/DIR=!/D=!g' \ - "$dir/Dockerfile" - ;; - esac - done -done +./versions.sh "$@" +./apply-templates.sh "$@" diff --git a/versions.json b/versions.json new file mode 100644 index 00000000..54ee966c --- /dev/null +++ b/versions.json @@ -0,0 +1,102 @@ +{ + "1.10": { + "arches": { + "amd64": { + "sha256": "21b2c69806aacf191d7c81806c7d9918bddab30c7b5b8d4251389c3abe274334", + "url": "https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.7-linux-x86_64.tar.gz" + }, + "arm64v8": { + "sha256": "93bf1b113f297c817310f77d1edce4ab9dcbf49432489cb8df09afbf93d1e5a0", + "url": "https://julialang-s3.julialang.org/bin/linux/aarch64/1.10/julia-1.10.7-linux-aarch64.tar.gz" + }, + "darwin-amd64": { + "sha256": "4643d1052ed478b646be06f545b50698fbc572b216dcca3bca69f429ce0e1321", + "url": "https://julialang-s3.julialang.org/bin/mac/x64/1.10/julia-1.10.7-mac64.tar.gz" + }, + "darwin-arm64v8": { + "sha256": "8beb61a29a6c32e26f55070dba8ded37f8572ad07aebd461a06ff5b10d48dc36", + "url": "https://julialang-s3.julialang.org/bin/mac/aarch64/1.10/julia-1.10.7-macaarch64.tar.gz" + }, + "freebsd-amd64": { + "sha256": "0e85b0fe86498b5662ad60b67bb814899d724c3cb96a58b135865c1781d23273", + "url": "https://julialang-s3.julialang.org/bin/freebsd/x64/1.10/julia-1.10.7-freebsd-x86_64.tar.gz" + }, + "i386": { + "sha256": "3e5afefd8a77d1e96b7037bfcd23def8f8993e3d0ca8408fffb292fa60a25cd0", + "url": "https://julialang-s3.julialang.org/bin/linux/x86/1.10/julia-1.10.7-linux-i686.tar.gz" + }, + "ppc64le": { + "sha256": "6c8b3d4b05a5620efa68abc146c267e198dc0cd71a2c7bc02662fa0a424f679c", + "url": "https://julialang-s3.julialang.org/bin/linux/ppc64le/1.10/julia-1.10.7-linux-ppc64le.tar.gz" + }, + "windows-amd64": { + "sha256": "51689d4e608fb78468ffabf55fd72896c3f3d84770cf58accb87cd0a57e9cbb8", + "url": "https://julialang-s3.julialang.org/bin/winnt/x64/1.10/julia-1.10.7-win64.exe" + }, + "windows-i386": { + "sha256": "16a5eac122749034efcbc5b82b4ba43fa1684ee2788656d7924775d5f7354ff6", + "url": "https://julialang-s3.julialang.org/bin/winnt/x86/1.10/julia-1.10.7-win32.exe" + } + }, + "variants": [ + "bookworm", + "bullseye", + "windows/windowsservercore-ltsc2022", + "windows/windowsservercore-1809" + ], + "version": "1.10.7" + }, + "1.11": { + "arches": { + "alpine-amd64": { + "sha256": "dc7d2ec533c33f385683bad892d09c9f09f124061fa00ab7e4dd2e0912d55c19", + "url": "https://julialang-s3.julialang.org/bin/musl/x64/1.11/julia-1.11.2-musl-x86_64.tar.gz" + }, + "amd64": { + "sha256": "8a372ad262d4d4d55a1044f4fe3bce7c9a4a3ce8c513d2470e58e8071eecd476", + "url": "https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.2-linux-x86_64.tar.gz" + }, + "arm64v8": { + "sha256": "0346e6d65852a3b73ced2c80c40f5a8cf38e7048d001cd57d3d1dd9efb2f6641", + "url": "https://julialang-s3.julialang.org/bin/linux/aarch64/1.11/julia-1.11.2-linux-aarch64.tar.gz" + }, + "darwin-amd64": { + "sha256": "0b52ba3d7f283e43ba853bc3d0f401decf993d8d53da752bd644a9f934679184", + "url": "https://julialang-s3.julialang.org/bin/mac/x64/1.11/julia-1.11.2-mac64.tar.gz" + }, + "darwin-arm64v8": { + "sha256": "bcfe9c788f3dcf613a4753a4d9771d8381d00caf0e8af64d8aa87af10068b754", + "url": "https://julialang-s3.julialang.org/bin/mac/aarch64/1.11/julia-1.11.2-macaarch64.tar.gz" + }, + "freebsd-amd64": { + "sha256": "abd3c7a10678948aabdf0d55670004b7aed35dc56f7dd174fede4cf372f3af85", + "url": "https://julialang-s3.julialang.org/bin/freebsd/x64/1.11/julia-1.11.2-freebsd-x86_64.tar.gz" + }, + "i386": { + "sha256": "a0b6e1e3a017c3db142f4c928006617870389d5f67c43adc4d0681b3bcd6c528", + "url": "https://julialang-s3.julialang.org/bin/linux/x86/1.11/julia-1.11.2-linux-i686.tar.gz" + }, + "ppc64le": { + "sha256": "953829671af91de7002fffaec93ec8b40a063e84ad048a854f722f3cf4f76d18", + "url": "https://julialang-s3.julialang.org/bin/linux/ppc64le/1.11/julia-1.11.2-linux-ppc64le.tar.gz" + }, + "windows-amd64": { + "sha256": "617c6b4d5fadea5ed05cba649377ec7c0c83519da4249c247db5a7812dc6f0c1", + "url": "https://julialang-s3.julialang.org/bin/winnt/x64/1.11/julia-1.11.2-win64.exe" + }, + "windows-i386": { + "sha256": "6445da5ff10963f15c9dd5ce3f7c889be5b042ec4fc629290497414cd08ba31f", + "url": "https://julialang-s3.julialang.org/bin/winnt/x86/1.11/julia-1.11.2-win32.exe" + } + }, + "variants": [ + "bookworm", + "bullseye", + "alpine3.21", + "alpine3.20", + "windows/windowsservercore-ltsc2022", + "windows/windowsservercore-1809" + ], + "version": "1.11.2" + } +} diff --git a/versions.sh b/versions.sh new file mode 100755 index 00000000..bf762d8c --- /dev/null +++ b/versions.sh @@ -0,0 +1,127 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" + +versions=( "$@" ) +if [ ${#versions[@]} -eq 0 ]; then + versions=( */ ) + json='{}' +else + json="$(< versions.json)" +fi +versions=( "${versions[@]%/}" ) + +# https://julialang.org/downloads/#json_release_feed +# https://julialang-s3.julialang.org/bin/versions.json +# https://julialang-s3.julialang.org/bin/versions-schema.json +juliaVersions="$( + wget -qO- 'https://julialang-s3.julialang.org/bin/versions.json' | jq -c ' + [ + to_entries[] + | .key as $version + | .value + | ( + ($version | sub("^(?[0-9]+[.][0-9]+).*$"; "\(.m)")) + + if .stable then "" else "-rc" end + ) as $major + | { + version: $version, + major: $major, + arches: (.files | map( + # map values from the julia versions-schema.json to bashbrew architecture values + # (plus some extra fiddly bits for Alpine) + { + mac: "darwin", + winnt: "windows", + linux: ( + if .triplet | endswith("-musl") then + "alpine" + else + "linux" + end + ), + freebsd: "freebsd", + }[.os] as $os + | { + x86_64: "amd64", + i686: "i386", + powerpc64le: "ppc64le", + aarch64: "arm64v8", + armv7l: "arm32v7", + }[.arch] as $arch + | if $os == null or $arch == null then empty + elif .kind != (if $os == "windows" then "installer" else "archive" end) then empty + else { + key: ( + if $os == "linux" then "" else $os + "-" end + + $arch + ), + value: { + url: .url, + sha256: .sha256, + }, + } end + ) | from_entries), + } + ] | sort_by([.major, .version] | map(split("[.-]"; "") | map(if test("^[0-9]+$") then tonumber else . end))) + ' +)" + +for version in "${versions[@]}"; do + rcVersion="${version%-rc}" + export version rcVersion + + if \ + ! doc="$(jq <<<"$juliaVersions" -ce ' + [ .[] | select(.major == env.version) ][-1] + ')" \ + || ! fullVersion="$(jq <<<"$doc" -r '.version')" \ + || [ -z "$fullVersion" ] \ + ; then + echo >&2 "warning: cannot find full version for $version" + continue + fi + + echo "$version: $fullVersion" + + if [ "$rcVersion" != "$version" ] && gaFullVersion="$(jq <<<"$json" -er '.[env.rcVersion] | if . then .version else empty end')"; then + # Julia pre-releases have always only been for .0, so if our pre-release now has a relevant GA, it should go away 👀 + # $ wget -qO- 'https://julialang-s3.julialang.org/bin/versions.json' | jq 'keys_unsorted[]' -r | grep -E '[^0]-' + # just in case, we'll also do a version comparison to make sure we don't have a pre-release that's newer than the relevant GA + latestVersion="$({ echo "$fullVersion"; echo "$gaFullVersion"; } | sort -V | tail -1)" + if [[ "$fullVersion" == "$gaFullVersion"* ]] || [ "$latestVersion" = "$gaFullVersion" ]; then + # "x.y.z-rc1" == x.y.z* + json="$(jq <<<"$json" -c 'del(.[env.version])')" + continue + fi + fi + + json="$(jq <<<"$json" -c --argjson doc "$doc" '.[env.version] = ( + $doc + | del(.major) + | .variants = ([ + "bookworm", + "bullseye", + if .arches | keys | any(startswith("alpine-")) then + "3.21", + "3.20", + empty + | "alpine" + . + else empty end, + if .arches | has("windows-amd64") then + "ltsc2022", + "1809", + empty + | "windows/windowsservercore-" + . + else empty end + ]) + )')" + + # make sure pre-release versions have a placeholder for GA + if [ "$version" != "$rcVersion" ]; then + json="$(jq <<<"$json" -c '.[env.rcVersion] //= null')" + fi +done + +jq <<<"$json" -S . > versions.json