@@ -14,30 +14,24 @@ COPY . ./
1414# Precompile for faster startup
1515# ENV JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"
1616
17-
18- # Auto-detect architecture and set CPU target
19- # Set CPU target and precompile within Julia
20- RUN julia --project=. <<'EOF'
21- arch = Sys.ARCH
22-
23- cpu_target = if arch == :x86_64
24- "generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"
25- elseif arch == :aarch64
26- "generic;apple-m1"
27- else
28- "generic"
29- end
30-
31- println("Detected Julia architecture: $arch" )
32- println("Using JULIA_CPU_TARGET: $cpu_target" )
33-
34- using Pkg
35- withenv("JULIA_CPU_TARGET" => cpu_target) do
36- Pkg.precompile()
37- end
38-
39- println("Precompilation completed with optimized target!" )
40- EOF
17+ # Auto-detect architecture and set CPU target, then precompile
18+ RUN julia --project=. -e ' \
19+ arch = Sys.ARCH; \
20+ cpu_target = if arch == :x86_64; \
21+ "generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"; \
22+ elseif arch == :aarch64; \
23+ "generic;apple-m1"; \
24+ else; \
25+ "generic"; \
26+ end; \
27+ println("Detected Julia architecture: $arch"); \
28+ println("Using JULIA_CPU_TARGET: $cpu_target"); \
29+ using Pkg; \
30+ withenv("JULIA_CPU_TARGET" => cpu_target) do; \
31+ Pkg.precompile(); \
32+ end; \
33+ println("Precompilation completed with optimized target!"); \
34+ '
4135
4236# Create home directory structure
4337RUN mkdir -p /home/registrar
0 commit comments