@@ -27,22 +27,25 @@ LABEL org.opencontainers.image.authors="Tim Besard <tim.besard@gmail.com>" \
27
27
28
28
# system-wide packages
29
29
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:
33
31
34
32
# pre-install the CUDA toolkit from an artifact. we do this separately from CUDA.jl so that
35
33
# this layer can be cached independently. it also avoids double precompilation of CUDA.jl in
36
34
# 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 =# \
38
39
env = "/usr/local/share/julia/environments/v$(VERSION.major).$(VERSION.minor)"; \
39
40
mkpath(env); \
40
41
write("$env/LocalPreferences.toml", \
41
42
"[CUDA_Runtime_jll]\n version = \" ' ${CUDA_VERSION}'\" "); \
42
43
\
43
44
#= install the JLL =# \
44
45
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 \{\} \; `)' && \
46
49
# = demote the JLL to an [extras] dep =# \
47
50
find /usr/local/share/julia/environments -name Project.toml -exec sed -i 's/deps/extras/' {} + && \
48
51
# = remove nondeterminisms =# \
@@ -69,7 +72,6 @@ RUN mkdir -m 0777 /depot
69
72
70
73
# we add the user environment from a start-up script
71
74
# so that the user can mount `/depot` for persistency
72
- ENV JULIA_DEPOT_PATH=/usr/local/share/julia:
73
75
COPY <<EOF /usr/local/share/julia/config/startup.jl
74
76
if !isdir("/depot/environments/v$(VERSION.major).$(VERSION.minor)" )
75
77
if isinteractive() && Base.JLOptions().quiet == 0
0 commit comments