forked from docker-library/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-alpine.template
43 lines (38 loc) · 1.43 KB
/
Dockerfile-alpine.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM alpine:%%TAG%%
ENV JULIA_PATH /usr/local/julia
ENV PATH $JULIA_PATH/bin:$PATH
# https://julialang.org/juliareleases.asc
# Julia (Binary signing key) <[email protected]>
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"]