Skip to content

Commit 1e3aa81

Browse files
Smaller image size
- strip all binaries - no explicit instantiation for Trilinos
1 parent 833b91d commit 1e3aa81

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

spack/Dockerfile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ RUN --mount=type=cache,target=/buildcache source /spack/share/spack/setup-env.sh
4242
RUN --mount=type=cache,target=/buildcache source /spack/share/spack/setup-env.sh && \
4343
spack env create tools --without-view && \
4444
spack env activate tools && \
45-
spack add cmake autotools && \
46-
spack concretize -f && spack install --fail-fast && \
47-
spack buildcache create -a -m cache && \
48-
spack uninstall --all
45+
spack add cmake meson m4 pkgconf autoconf automake libtool && \
46+
spack concretize -f && (spack install --fail-fast ; \
47+
spack buildcache create -a -m cache) && \
48+
spack uninstall -y --all
4949

5050
# Define and compile an alien environment
5151
RUN --mount=type=cache,target=/buildcache source /spack/share/spack/setup-env.sh && \
5252
spack buildcache update-index -d /buildcache && \
5353
spack env create alien --without-view && \
5454
spack env activate alien && \
55-
spack add alien +hypre+petsc+xml+hdf5+move+ref ginkgo=omp trilinos=omp && \
56-
spack concretize -f && spack install --fail-fast && \
57-
spack buildcache create -a -m cache
55+
spack add alien +hypre+petsc+xml+hdf5+move+ref ginkgo=omp trilinos=omp ^trilinos~explicit_template_instantiation && \
56+
spack concretize -f && (spack install --fail-fast; \
57+
spack buildcache create -a -m cache)
5858

5959
# # Define and compile an arcane environment
6060
# RUN source /spack/share/spack/setup-env.sh && \
@@ -74,5 +74,12 @@ RUN --mount=type=cache,target=/buildcache source /spack/share/spack/setup-env.sh
7474
# RUN source /spack/share/spack/setup-env.sh && \
7575
# spack clean -a
7676

77+
# Strip all the binaries
78+
RUN find -L /spack/opt/* -type f -exec readlink -f '{}' \; | \
79+
xargs file -i | \
80+
grep 'charset=binary' | \
81+
grep 'x-executable\|x-archive\|x-sharedlib' | \
82+
awk -F: '{print $1}' | xargs strip -s
83+
7784
FROM base AS final
7885
COPY --from=builder /spack/opt/ /spack/

0 commit comments

Comments
 (0)