MilesCranmer commited on
Commit
5b00b7d
·
1 Parent(s): f4bab22

Avoid using `juliaup` in dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -30
Dockerfile CHANGED
@@ -13,38 +13,32 @@ LABEL org.opencontainers.image.licenses = "Apache License 2.0"
13
  # Need to use ARG after FROM, otherwise it won't get passed through.
14
  ARG JLVERSION=1.8.2
15
 
16
- RUN apt-get update && apt-get install -yq \
17
- expect \
18
- build-essential \
19
- curl \
20
- git \
21
- libssl-dev \
22
- libffi-dev \
23
- libxml2 \
24
- libxml2-dev \
25
- libxslt1.1 \
26
- libxslt-dev \
27
- libz-dev \
28
- nano \
29
- && apt-get clean && rm -rf /var/lib/apt/lists/*
30
 
31
- # Install juliaup:
32
- RUN curl -fsSL https://install.julialang.org -o install-julia.sh && \
33
- # Fix for docker buildx https://github.com/rust-lang/rustup/issues/2700
34
- sed -i 's#/proc/self/exe#$(which head)#g' install-julia.sh && \
35
- sed -i 's#/proc/cpuinfo#/proc/cpuinfo 2> /dev/null || echo ''#g' install-julia.sh && \
36
- sed -i 's#get_architecture || return 1#RETVAL=$(gcc -dumpmachine | sed "s/-/-unknown-/") #g' install-julia.sh && \
37
- # Fix for non-interactivity https://github.com/JuliaLang/juliaup/issues/253
38
- echo '#!/usr/bin/expect\nspawn ./install-julia.sh\nexpect "Cancel installation"\nsend -- "\\r"\nexpect eof' >> install-julia.exp && \
39
- chmod +x install-julia.sh && \
40
- chmod +x install-julia.exp && \
41
- ./install-julia.exp && \
42
- rm install-julia.sh && \
43
- rm install-julia.exp
44
 
45
- ENV JULIAUP_ROOT /root/.julia/juliaup
46
- ENV PATH "${JULIAUP_ROOT}/bin:${PATH}"
47
- RUN juliaup add $JLVERSION && juliaup default $JLVERSION && juliaup update
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  # Install IPython and other useful libraries:
50
  RUN pip install ipython matplotlib
 
13
  # Need to use ARG after FROM, otherwise it won't get passed through.
14
  ARG JLVERSION=1.8.2
15
 
16
+ ENV PYVERSION $PYVERSION
17
+ ENV JLVERSION $JLVERSION
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
+ # arm64:
20
+ # https://julialang-s3.julialang.org/bin/linux/aarch64/1.8/julia-1.8.2-linux-aarch64.tar.gz
21
+ # amd64:
22
+ # https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.2-linux-x86_64.tar.gz
 
 
 
 
 
 
 
 
 
23
 
24
+ RUN export JULIA_VER=$(echo $JLVERSION | cut -d '.' -f -2) && \
25
+ export ARCH=$(arch | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/') && \
26
+ if [ "$ARCH" = "amd64" ]; then \
27
+ export BASE_URL="https://julialang-s3.julialang.org/bin/linux/x64/$JULIA_VER" && \
28
+ export FULL_URL=$BASE_URL/julia-$JLVERSION-linux-x86_64.tar.gz; \
29
+ elif [ "$ARCH" = "arm64" ]; then \
30
+ export BASE_URL="https://julialang-s3.julialang.org/bin/linux/aarch64/$JULIA_VER"; \
31
+ export FULL_URL=$BASE_URL/julia-$JLVERSION-linux-aarch64.tar.gz; \
32
+ else \
33
+ echo "Download link for architecture ${ARCH} not found. Please add the corresponding Julia download URL to this Dockerfile." && \
34
+ exit 1; \
35
+ fi && \
36
+ wget -nv $FULL_URL -O julia.tar.gz && \
37
+ tar -xzf julia.tar.gz && \
38
+ rm julia.tar.gz && \
39
+ mv julia-$JLVERSION /opt/julia && \
40
+ ln -s /opt/julia/bin/julia /usr/local/bin/julia && \
41
+ echo "HELLo"
42
 
43
  # Install IPython and other useful libraries:
44
  RUN pip install ipython matplotlib