Add initial jq-based templating engine

This commit is contained in:
Tianon Gravi 2021-11-29 17:39:49 -08:00
parent 815a93c632
commit cae81400f4
33 changed files with 961 additions and 523 deletions

View File

@ -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"
}

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
/*/**/Dockerfile linguist-generated
/Dockerfile*.template linguist-language=Dockerfile

22
.github/workflows/verify-templating.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Verify Templating
on:
pull_request:
push:
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
jobs:
apply-templates:
name: Check For Uncomitted Changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Apply Templates
run: ./apply-templates.sh
- name: Check Git Status
run: |
status="$(git status --short)"
[ -z "$status" ]

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.jq-template.awk

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM debian:bullseye-slim
RUN set -eux; \
@ -33,25 +39,34 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
'amd64') \
url='https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.5-linux-x86_64.tar.gz'; \
sha256='9dedd613777ba6ebd8aee5796915ff50aa6188ea03ed143cb687fc2aefd76b03'; \
;; \
'armhf') \
url='https://julialang-s3.julialang.org/bin/linux/armv7l/1.0/julia-1.0.5-linux-armv7l.tar.gz'; \
sha256='cfb2712765db90f0e4fa27e57a88c6d994ebcf1781f8673ebb17b5df7962d0c5'; \
;; \
'arm64') \
url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.0/julia-1.0.5-linux-aarch64.tar.gz'; \
sha256='41cea1336ed8861413bb945740e567360e26f241eb3e10b3bb0fccd25655ed28'; \
;; \
'i386') \
url='https://julialang-s3.julialang.org/bin/linux/x86/1.0/julia-1.0.5-linux-i686.tar.gz'; \
sha256='67c8f31699b79df96ce95926a363cd24ffa5bb4d9a814e071b1e8c8ff33e5a8f'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
curl -fL -o julia.tar.gz.asc "$url.asc"; \
curl -fL -o julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

47
1.0/buster/Dockerfile generated
View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM debian:buster-slim
RUN set -eux; \
@ -33,25 +39,34 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
'amd64') \
url='https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.5-linux-x86_64.tar.gz'; \
sha256='9dedd613777ba6ebd8aee5796915ff50aa6188ea03ed143cb687fc2aefd76b03'; \
;; \
'armhf') \
url='https://julialang-s3.julialang.org/bin/linux/armv7l/1.0/julia-1.0.5-linux-armv7l.tar.gz'; \
sha256='cfb2712765db90f0e4fa27e57a88c6d994ebcf1781f8673ebb17b5df7962d0c5'; \
;; \
'arm64') \
url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.0/julia-1.0.5-linux-aarch64.tar.gz'; \
sha256='41cea1336ed8861413bb945740e567360e26f241eb3e10b3bb0fccd25655ed28'; \
;; \
'i386') \
url='https://julialang-s3.julialang.org/bin/linux/x86/1.0/julia-1.0.5-linux-i686.tar.gz'; \
sha256='67c8f31699b79df96ce95926a363cd24ffa5bb4d9a814e071b1e8c8ff33e5a8f'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
curl -fL -o julia.tar.gz.asc "$url.asc"; \
curl -fL -o julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -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.0.5
ENV JULIA_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0.5-win64.exe
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); \
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
'/D=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"]

View File

@ -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: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_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0.5-win64.exe
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); \
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
'/D=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"]

View File

@ -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.0.5
ENV JULIA_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0.5-win64.exe
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); \
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
'/D=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"]

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM alpine:3.14
ENV JULIA_PATH /usr/local/julia
@ -16,19 +22,22 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(apk --print-arch)"; \
case "$arch" in \
'x86_64') \
url='https://julialang-s3.julialang.org/bin/musl/x64/1.6/julia-1.6.4-musl-x86_64.tar.gz'; \
sha256='63f121dffa982ff9b53c7c8a334830e17e2c9d2efa79316a548d29f7f8925e66'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
wget -O julia.tar.gz.asc "$url.asc"; \
wget -O julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum -w -c -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM alpine:3.15
ENV JULIA_PATH /usr/local/julia
@ -16,19 +22,22 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(apk --print-arch)"; \
case "$arch" in \
'x86_64') \
url='https://julialang-s3.julialang.org/bin/musl/x64/1.6/julia-1.6.4-musl-x86_64.tar.gz'; \
sha256='63f121dffa982ff9b53c7c8a334830e17e2c9d2efa79316a548d29f7f8925e66'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
wget -O julia.tar.gz.asc "$url.asc"; \
wget -O julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum -w -c -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM debian:bullseye-slim
RUN set -eux; \
@ -33,25 +39,34 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
'amd64') \
url='https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.4-linux-x86_64.tar.gz'; \
sha256='52244ae47697e8073dfbc9d1251b0422f0dbd1fbe1a41da4b9f7ddf0506b2132'; \
;; \
'armhf') \
url='https://julialang-s3.julialang.org/bin/linux/armv7l/1.6/julia-1.6.4-linux-armv7l.tar.gz'; \
sha256='9ad3f6bd71eb6840d4cef1569855da20c0b4931a2bdf77703a64df672b0702a1'; \
;; \
'arm64') \
url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.6/julia-1.6.4-linux-aarch64.tar.gz'; \
sha256='072daac7229c15fa41d0c1b65b8a3d6ee747323d02f5943da3846b075291b48b'; \
;; \
'i386') \
url='https://julialang-s3.julialang.org/bin/linux/x86/1.6/julia-1.6.4-linux-i686.tar.gz'; \
sha256='9d43d642174cf22cf0fde18dc2578c84f357d2c619b9d846d3a6da4192ba48cf'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
curl -fL -o julia.tar.gz.asc "$url.asc"; \
curl -fL -o julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

47
1.6/buster/Dockerfile generated
View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM debian:buster-slim
RUN set -eux; \
@ -33,25 +39,34 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
'amd64') \
url='https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.4-linux-x86_64.tar.gz'; \
sha256='52244ae47697e8073dfbc9d1251b0422f0dbd1fbe1a41da4b9f7ddf0506b2132'; \
;; \
'armhf') \
url='https://julialang-s3.julialang.org/bin/linux/armv7l/1.6/julia-1.6.4-linux-armv7l.tar.gz'; \
sha256='9ad3f6bd71eb6840d4cef1569855da20c0b4931a2bdf77703a64df672b0702a1'; \
;; \
'arm64') \
url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.6/julia-1.6.4-linux-aarch64.tar.gz'; \
sha256='072daac7229c15fa41d0c1b65b8a3d6ee747323d02f5943da3846b075291b48b'; \
;; \
'i386') \
url='https://julialang-s3.julialang.org/bin/linux/x86/1.6/julia-1.6.4-linux-i686.tar.gz'; \
sha256='9d43d642174cf22cf0fde18dc2578c84f357d2c619b9d846d3a6da4192ba48cf'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
curl -fL -o julia.tar.gz.asc "$url.asc"; \
curl -fL -o julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -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_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.6/julia-1.6.4-win64.exe
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); \
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"]

View File

@ -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: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_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.6/julia-1.6.4-win64.exe
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); \
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"]

View File

@ -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_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.6/julia-1.6.4-win64.exe
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); \
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"]

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM alpine:3.14
ENV JULIA_PATH /usr/local/julia
@ -16,19 +22,22 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(apk --print-arch)"; \
case "$arch" in \
'x86_64') \
url='https://julialang-s3.julialang.org/bin/musl/x64/1.7/julia-1.7.0-rc3-musl-x86_64.tar.gz'; \
sha256='68dc3d7b17fbcceea383b48d82c63c36b899e05f5cd7537a730d7578f65c40ea'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
wget -O julia.tar.gz.asc "$url.asc"; \
wget -O julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum -w -c -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM alpine:3.15
ENV JULIA_PATH /usr/local/julia
@ -16,19 +22,22 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(apk --print-arch)"; \
case "$arch" in \
'x86_64') \
url='https://julialang-s3.julialang.org/bin/musl/x64/1.7/julia-1.7.0-rc3-musl-x86_64.tar.gz'; \
sha256='68dc3d7b17fbcceea383b48d82c63c36b899e05f5cd7537a730d7578f65c40ea'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
wget -O julia.tar.gz.asc "$url.asc"; \
wget -O julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum -w -c -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM debian:bullseye-slim
RUN set -eux; \
@ -33,25 +39,34 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
'amd64') \
url='https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.0-rc3-linux-x86_64.tar.gz'; \
sha256='cbf33c533d6f226161f08cdc3cec16745a3dc5afdfbaece95e3f2a5e0b6b7886'; \
;; \
'armhf') \
url='https://julialang-s3.julialang.org/bin/linux/armv7l/1.7/julia-1.7.0-rc3-linux-armv7l.tar.gz'; \
sha256='fff9370f58fd8f94f12a14d38c32d25b9e493d62a6d992edfc378caf9ef8d1cc'; \
;; \
'arm64') \
url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.7/julia-1.7.0-rc3-linux-aarch64.tar.gz'; \
sha256='0662f9f31c87559ec33a24b3b83df85071357708287678ca78c7fa4498d05e5c'; \
;; \
'i386') \
url='https://julialang-s3.julialang.org/bin/linux/x86/1.7/julia-1.7.0-rc3-linux-i686.tar.gz'; \
sha256='9ee7692faee05d7dbe431c59850542d95d260368bbf6d4f0ccdd03be07fef817'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
curl -fL -o julia.tar.gz.asc "$url.asc"; \
curl -fL -o julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -1,3 +1,9 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM debian:buster-slim
RUN set -eux; \
@ -33,25 +39,34 @@ RUN set -eux; \
\
# 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 ;; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
'amd64') \
url='https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.0-rc3-linux-x86_64.tar.gz'; \
sha256='cbf33c533d6f226161f08cdc3cec16745a3dc5afdfbaece95e3f2a5e0b6b7886'; \
;; \
'armhf') \
url='https://julialang-s3.julialang.org/bin/linux/armv7l/1.7/julia-1.7.0-rc3-linux-armv7l.tar.gz'; \
sha256='fff9370f58fd8f94f12a14d38c32d25b9e493d62a6d992edfc378caf9ef8d1cc'; \
;; \
'arm64') \
url='https://julialang-s3.julialang.org/bin/linux/aarch64/1.7/julia-1.7.0-rc3-linux-aarch64.tar.gz'; \
sha256='0662f9f31c87559ec33a24b3b83df85071357708287678ca78c7fa4498d05e5c'; \
;; \
'i386') \
url='https://julialang-s3.julialang.org/bin/linux/x86/1.7/julia-1.7.0-rc3-linux-i686.tar.gz'; \
sha256='9ee7692faee05d7dbe431c59850542d95d260368bbf6d4f0ccdd03be07fef817'; \
;; \
*) \
echo >&2 "error: current architecture ($arch) 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"; \
curl -fL -o julia.tar.gz.asc "$url.asc"; \
curl -fL -o julia.tar.gz "$url"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
echo "$sha256 *julia.tar.gz" | sha256sum --strict --check -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"; \

View File

@ -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_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.7/julia-1.7.0-rc3-win64.exe
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); \
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"]

View File

@ -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: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_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.7/julia-1.7.0-rc3-win64.exe
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); \
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"]

View File

@ -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_URL https://julialang-s3.julialang.org/bin/winnt/x64/1.7/julia-1.7.0-rc3-win64.exe
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); \
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"]

View File

@ -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) <buildbot@julialang.org>
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"]

View File

@ -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) <buildbot@julialang.org>
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"]

129
Dockerfile-linux.template Normal file
View File

@ -0,0 +1,129 @@
{{
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) <buildbot@julialang.org>
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)"; \
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; \
{{ ) 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; \
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; \
\
{{ 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
CMD ["julia"]

View File

@ -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) { \
@ -21,10 +21,21 @@ RUN $url = ('https://julialang-s3.julialang.org/bin/winnt/x64/{1}/julia-{0}-win6
Start-Process -Wait -NoNewWindow \
-FilePath '.\julia.exe' \
-ArgumentList @( \
{{
# https://github.com/JuliaLang/julia/blob/v1.4.0-rc1/NEWS.md#build-system-changes
if env.version == "1.0" then (
-}}
'/S', \
'/D=C:\julia' \
{{ ) else ( -}}
'/SILENT', \
'/DIR=C:\julia' \
{{ ) end -}}
); \
\
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 +43,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"]

65
apply-templates.sh Executable file
View File

@ -0,0 +1,65 @@
#!/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/1da7341a79651d28fbcc3d14b9176593c4231942/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/"
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")" # "buster", "windowsservercore-1809", etc
export variant
case "$dir" in
windows/*)
windowsVariant="${variant%%-*}" # "windowsservercore", "nanoserver"
windowsRelease="${variant#$windowsVariant-}" # "1809", "ltsc2016", etc
windowsVariant="${windowsVariant#windows}" # "servercore", "nanoserver"
export windowsVariant windowsRelease
template="Dockerfile-windows-$windowsVariant.template"
;;
*)
template='Dockerfile-linux.template'
;;
esac
echo "processing $version/$dir ..."
{
generated_warning
gawk -f "$jqt" "$template"
} > "$version/$dir/Dockerfile"
done
done

View File

@ -4,17 +4,17 @@ 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,15 +26,19 @@ 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
)
}
@ -54,24 +58,6 @@ getArches() {
}
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 +73,97 @@ 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")"
for version; do
export version
variants="$(jq -r '.[env.version].variants | map(@sh) | join(" ")' versions.json)"
eval "variants=( $variants )"
[ -f "$dir/Dockerfile" ] || continue
fullVersion="$(jq -r '.[env.version].version' versions.json)"
commit="$(dirCommit "$dir")"
fullVersion="$(git show "$commit":"$dir/Dockerfile" | awk '$1 == "ENV" && $2 == "JULIA_VERSION" { print $3; exit }')"
versionAliases=()
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%[.-]*}"
done
versionAliases+=(
versionAliases=(
$fullVersion
$version
${aliases[$version]:-}
)
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}" )
if [ "$variant" = "$defaultAlpineVariant" ]; then
sharedTags=()
case "$variant" in
"$defaultDebianVariant" | windowsservercore-*)
sharedTags=( "${versionAliases[@]}" )
;;
"$defaultAlpineVariant")
variantAliases+=( "${versionAliases[@]/%/-alpine}" )
fi
;;
esac
variantAliases=( "${variantAliases[@]//latest-/}" )
sharedTags=()
if [ "$variant" = "$defaultDebianVariant" ] || [[ "$variant" == 'windowsservercore'* ]]; then
sharedTags+=( "${versionAliases[@]}" )
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 +176,6 @@ for version in "${versions[@]}"; do
GitCommit: $commit
Directory: $dir
EOE
[[ "$v" == windows/* ]] && echo "Constraints: $variant"
[ -z "$constraints" ] || echo "Constraints: $constraints"
done
done

View File

@ -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

117
update.sh
View File

@ -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 "$@"

150
versions.json Normal file
View File

@ -0,0 +1,150 @@
{
"1.0": {
"arches": {
"amd64": {
"sha256": "9dedd613777ba6ebd8aee5796915ff50aa6188ea03ed143cb687fc2aefd76b03",
"url": "https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.5-linux-x86_64.tar.gz"
},
"arm32v7": {
"sha256": "cfb2712765db90f0e4fa27e57a88c6d994ebcf1781f8673ebb17b5df7962d0c5",
"url": "https://julialang-s3.julialang.org/bin/linux/armv7l/1.0/julia-1.0.5-linux-armv7l.tar.gz"
},
"arm64v8": {
"sha256": "41cea1336ed8861413bb945740e567360e26f241eb3e10b3bb0fccd25655ed28",
"url": "https://julialang-s3.julialang.org/bin/linux/aarch64/1.0/julia-1.0.5-linux-aarch64.tar.gz"
},
"darwin-amd64": {
"sha256": "1ff7bd41f396ba3f34dc17c26b78d11adeadfafdea537f7ad17020ef812a39a0",
"url": "https://julialang-s3.julialang.org/bin/mac/x64/1.0/julia-1.0.5-mac64.dmg"
},
"freebsd-amd64": {
"sha256": "3bae7ac8afa972ba1febec208f4679430bfc61df85415588f6bb253415d661ac",
"url": "https://julialang-s3.julialang.org/bin/freebsd/x64/1.0/julia-1.0.5-freebsd-x86_64.tar.gz"
},
"i386": {
"sha256": "67c8f31699b79df96ce95926a363cd24ffa5bb4d9a814e071b1e8c8ff33e5a8f",
"url": "https://julialang-s3.julialang.org/bin/linux/x86/1.0/julia-1.0.5-linux-i686.tar.gz"
},
"windows-amd64": {
"sha256": "83c04bdc264e7ab87f4e22be9f3dff8c5a62a49c8edea6a0c85f4645d4cbac7a",
"url": "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0.5-win64.exe"
},
"windows-i386": {
"sha256": "16a26142e4d6fd85515ef896675fd09c1421761b8c6d19822851ec89b341b502",
"url": "https://julialang-s3.julialang.org/bin/winnt/x86/1.0/julia-1.0.5-win32.exe"
}
},
"variants": [
"bullseye",
"buster",
"windows/windowsservercore-ltsc2022",
"windows/windowsservercore-1809",
"windows/windowsservercore-ltsc2016"
],
"version": "1.0.5"
},
"1.6": {
"arches": {
"alpine-amd64": {
"sha256": "63f121dffa982ff9b53c7c8a334830e17e2c9d2efa79316a548d29f7f8925e66",
"url": "https://julialang-s3.julialang.org/bin/musl/x64/1.6/julia-1.6.4-musl-x86_64.tar.gz"
},
"amd64": {
"sha256": "52244ae47697e8073dfbc9d1251b0422f0dbd1fbe1a41da4b9f7ddf0506b2132",
"url": "https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.4-linux-x86_64.tar.gz"
},
"arm32v7": {
"sha256": "9ad3f6bd71eb6840d4cef1569855da20c0b4931a2bdf77703a64df672b0702a1",
"url": "https://julialang-s3.julialang.org/bin/linux/armv7l/1.6/julia-1.6.4-linux-armv7l.tar.gz"
},
"arm64v8": {
"sha256": "072daac7229c15fa41d0c1b65b8a3d6ee747323d02f5943da3846b075291b48b",
"url": "https://julialang-s3.julialang.org/bin/linux/aarch64/1.6/julia-1.6.4-linux-aarch64.tar.gz"
},
"darwin-amd64": {
"sha256": "a00598f04832b8f5d28039942280feadf40e8a14d7f6264c754ec70627507ace",
"url": "https://julialang-s3.julialang.org/bin/mac/x64/1.6/julia-1.6.4-mac64.dmg"
},
"freebsd-amd64": {
"sha256": "2a28938404103e0b7e77839308b49036f742b14d8a95da00c119d2db6e6fbfd7",
"url": "https://julialang-s3.julialang.org/bin/freebsd/x64/1.6/julia-1.6.4-freebsd-x86_64.tar.gz"
},
"i386": {
"sha256": "9d43d642174cf22cf0fde18dc2578c84f357d2c619b9d846d3a6da4192ba48cf",
"url": "https://julialang-s3.julialang.org/bin/linux/x86/1.6/julia-1.6.4-linux-i686.tar.gz"
},
"windows-amd64": {
"sha256": "c9b6ecdad4feb57e5af12c9ef1a74993a96edbf87a4dc521d57e338397cee9b2",
"url": "https://julialang-s3.julialang.org/bin/winnt/x64/1.6/julia-1.6.4-win64.exe"
},
"windows-i386": {
"sha256": "cd41b60beae2664f4ac9e9f30ca9f852aebc3ef00f393b26f126f5861695790d",
"url": "https://julialang-s3.julialang.org/bin/winnt/x86/1.6/julia-1.6.4-win32.exe"
}
},
"variants": [
"bullseye",
"buster",
"alpine3.15",
"alpine3.14",
"windows/windowsservercore-ltsc2022",
"windows/windowsservercore-1809",
"windows/windowsservercore-ltsc2016"
],
"version": "1.6.4"
},
"1.7-rc": {
"arches": {
"alpine-amd64": {
"sha256": "68dc3d7b17fbcceea383b48d82c63c36b899e05f5cd7537a730d7578f65c40ea",
"url": "https://julialang-s3.julialang.org/bin/musl/x64/1.7/julia-1.7.0-rc3-musl-x86_64.tar.gz"
},
"amd64": {
"sha256": "cbf33c533d6f226161f08cdc3cec16745a3dc5afdfbaece95e3f2a5e0b6b7886",
"url": "https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.0-rc3-linux-x86_64.tar.gz"
},
"arm32v7": {
"sha256": "fff9370f58fd8f94f12a14d38c32d25b9e493d62a6d992edfc378caf9ef8d1cc",
"url": "https://julialang-s3.julialang.org/bin/linux/armv7l/1.7/julia-1.7.0-rc3-linux-armv7l.tar.gz"
},
"arm64v8": {
"sha256": "0662f9f31c87559ec33a24b3b83df85071357708287678ca78c7fa4498d05e5c",
"url": "https://julialang-s3.julialang.org/bin/linux/aarch64/1.7/julia-1.7.0-rc3-linux-aarch64.tar.gz"
},
"darwin-amd64": {
"sha256": "16bc2f2c6fa901f8f40de0a8628eb8ac792d6b967b2277818ca5532b40acae84",
"url": "https://julialang-s3.julialang.org/bin/mac/x64/1.7/julia-1.7.0-rc3-mac64.dmg"
},
"darwin-arm64v8": {
"sha256": "4679b44c194c004037684c6dade8b988968b90adefee4d9483d8f82c61c3aa2b",
"url": "https://julialang-s3.julialang.org/bin/mac/aarch64/1.7/julia-1.7.0-rc3-macaarch64.dmg"
},
"freebsd-amd64": {
"sha256": "0ba30a862e990d27961d5c01952cef141bce99774f2e5a3a0a36f42b6c2173bb",
"url": "https://julialang-s3.julialang.org/bin/freebsd/x64/1.7/julia-1.7.0-rc3-freebsd-x86_64.tar.gz"
},
"i386": {
"sha256": "9ee7692faee05d7dbe431c59850542d95d260368bbf6d4f0ccdd03be07fef817",
"url": "https://julialang-s3.julialang.org/bin/linux/x86/1.7/julia-1.7.0-rc3-linux-i686.tar.gz"
},
"windows-amd64": {
"sha256": "d48563b3faeeb0d937177f989f5c8bfe79552ac11255000870ce770a97c69de8",
"url": "https://julialang-s3.julialang.org/bin/winnt/x64/1.7/julia-1.7.0-rc3-win64.exe"
},
"windows-i386": {
"sha256": "fb643f5128f92213a9d704186450a170a57e9975f8c307a0057ca6f18b499914",
"url": "https://julialang-s3.julialang.org/bin/winnt/x86/1.7/julia-1.7.0-rc3-win32.exe"
}
},
"variants": [
"bullseye",
"buster",
"alpine3.15",
"alpine3.14",
"windows/windowsservercore-ltsc2022",
"windows/windowsservercore-1809",
"windows/windowsservercore-ltsc2016"
],
"version": "1.7.0-rc3"
}
}

108
versions.sh Executable file
View File

@ -0,0 +1,108 @@
#!/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("^(?<m>[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
export version
if \
! doc="$(jq <<<"$juliaVersions" -c '
[ .[] | 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"
json="$(jq <<<"$json" -c --argjson doc "$doc" '.[env.version] = (
$doc
| del(.major)
| .variants = ([
"bullseye",
"buster",
if .arches | keys | any(startswith("alpine-")) then
"3.15",
"3.14"
| "alpine" + .
else empty end,
if .arches | has("windows-amd64") then
"ltsc2022",
"1809",
"ltsc2016"
| "windows/windowsservercore-" + .
else empty end
])
)')"
done
jq <<<"$json" -S . > versions.json