@@ -27,22 +27,25 @@ LABEL org.opencontainers.image.authors="Tim Besard <tim.besard@gmail.com>" \
2727
2828# system-wide packages
2929
30- # no trailing ':' as to ensure we don't touch anything outside this directory. without it,
31- # Julia touches the compilecache timestamps in its shipped depot (for some reason; a bug?)
32- ENV JULIA_DEPOT_PATH=/usr/local/share/julia
30+ ENV JULIA_DEPOT_PATH=/usr/local/share/julia:
3331
3432# pre-install the CUDA toolkit from an artifact. we do this separately from CUDA.jl so that
3533# this layer can be cached independently. it also avoids double precompilation of CUDA.jl in
3634# order to call `CUDA.set_runtime_version!`.
37- RUN julia -e '#= configure the preference =# \
35+ RUN julia -e '#= make bundled depot non-writable (JuliaLang/Pkg.jl#4120) =# \
36+ bundled_depot = last(DEPOT_PATH); \
37+ run(`find $bundled_depot/compiled -type f -writable -exec chmod -w \{\} \; `); \
38+ #= configure the preference =# \
3839 env = "/usr/local/share/julia/environments/v$(VERSION.major).$(VERSION.minor)"; \
3940 mkpath(env); \
4041 write("$env/LocalPreferences.toml", \
4142 "[CUDA_Runtime_jll]\n version = \" ' ${CUDA_VERSION}'\" "); \
4243 \
4344 #= install the JLL =# \
4445 using Pkg; \
45- Pkg.add("CUDA_Runtime_jll")' && \
46+ Pkg.add("CUDA_Runtime_jll"); \
47+ #= revert bundled depot changes =# \
48+ run(`find $bundled_depot/compiled -type f -writable -exec chmod +w \{\} \; `)' && \
4649 # = demote the JLL to an [extras] dep =# \
4750 find /usr/local/share/julia/environments -name Project.toml -exec sed -i 's/deps/extras/' {} + && \
4851 # = remove nondeterminisms =# \
@@ -69,7 +72,6 @@ RUN mkdir -m 0777 /depot
6972
7073# we add the user environment from a start-up script
7174# so that the user can mount `/depot` for persistency
72- ENV JULIA_DEPOT_PATH=/usr/local/share/julia:
7375COPY <<EOF /usr/local/share/julia/config/startup.jl
7476if !isdir("/depot/environments/v$(VERSION.major).$(VERSION.minor)" )
7577 if isinteractive() && Base.JLOptions().quiet == 0
0 commit comments