|
| 1 | +FROM debian:buster-slim |
| 2 | + |
| 3 | +RUN set -eux; \ |
| 4 | + apt-get update; \ |
| 5 | + apt-get install -y --no-install-recommends \ |
| 6 | + ca-certificates \ |
| 7 | +# ERROR: no download agent available; install curl, wget, or fetch |
| 8 | + curl \ |
| 9 | + ; \ |
| 10 | + rm -rf /var/lib/apt/lists/* |
| 11 | + |
| 12 | +ENV JULIA_PATH /usr/local/julia |
| 13 | +ENV PATH $JULIA_PATH/bin:$PATH |
| 14 | + |
| 15 | +# https://julialang.org/juliareleases.asc |
| 16 | +# Julia (Binary signing key) <[email protected]> |
| 17 | +ENV JULIA_GPG 3673DF529D9049477F76B37566E3C7DC03D6E495 |
| 18 | + |
| 19 | +# https://julialang.org/downloads/ |
| 20 | +ENV JULIA_VERSION 1.6.0-beta1 |
| 21 | + |
| 22 | +RUN set -eux; \ |
| 23 | + \ |
| 24 | + savedAptMark="$(apt-mark showmanual)"; \ |
| 25 | + if ! command -v gpg > /dev/null; then \ |
| 26 | + apt-get update; \ |
| 27 | + apt-get install -y --no-install-recommends \ |
| 28 | + gnupg \ |
| 29 | + dirmngr \ |
| 30 | + ; \ |
| 31 | + rm -rf /var/lib/apt/lists/*; \ |
| 32 | + fi; \ |
| 33 | + \ |
| 34 | +# https://julialang.org/downloads/#julia-command-line-version |
| 35 | +# https://julialang-s3.julialang.org/bin/checksums/julia-1.6.0-beta1.sha256 |
| 36 | +# this "case" statement is generated via "update.sh" |
| 37 | + dpkgArch="$(dpkg --print-architecture)"; \ |
| 38 | + case "${dpkgArch##*-}" in \ |
| 39 | +# amd64 |
| 40 | + amd64) tarArch='x86_64'; dirArch='x64'; sha256='30b214c7f544c6589a20104eaa6764eb368cadac5fa834b7454b747043e5a2b8' ;; \ |
| 41 | +# arm64v8 |
| 42 | + arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='6f4a0d63c7bc69b5e649710c31affe7e39a554c895235df50eddc9d26bcc3910' ;; \ |
| 43 | +# i386 |
| 44 | + i386) tarArch='i686'; dirArch='x86'; sha256='de8c8e3560974196c09b4a01c91591ce4faf8c77daf080fb37b9e2759c5df29d' ;; \ |
| 45 | +# ppc64le |
| 46 | + ppc64el) tarArch='ppc64le'; dirArch='ppc64le'; sha256='13f6192990d1c44039444707d8753d80b299c3fa05625ee9ca1680413ae344cd' ;; \ |
| 47 | + *) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \ |
| 48 | + esac; \ |
| 49 | + \ |
| 50 | + folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \ |
| 51 | + curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \ |
| 52 | + curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \ |
| 53 | + \ |
| 54 | + echo "${sha256} *julia.tar.gz" | sha256sum -c -; \ |
| 55 | + \ |
| 56 | + export GNUPGHOME="$(mktemp -d)"; \ |
| 57 | + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$JULIA_GPG"; \ |
| 58 | + gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \ |
| 59 | + command -v gpgconf > /dev/null && gpgconf --kill all; \ |
| 60 | + rm -rf "$GNUPGHOME" julia.tar.gz.asc; \ |
| 61 | + \ |
| 62 | + mkdir "$JULIA_PATH"; \ |
| 63 | + tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \ |
| 64 | + rm julia.tar.gz; \ |
| 65 | + \ |
| 66 | + apt-mark auto '.*' > /dev/null; \ |
| 67 | + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ |
| 68 | + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ |
| 69 | + \ |
| 70 | +# smoke test |
| 71 | + julia --version |
| 72 | + |
| 73 | +CMD ["julia"] |
0 commit comments