Skip to content
Snippets Groups Projects
Commit cc2c1106 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

feat: rm large copy into runtime image

parent 7aabfa5b
Branches
Tags
No related merge requests found
This commit is part of merge request !994. Comments created here will be created in the context of that merge request.
...@@ -230,6 +230,18 @@ spack -e ${SPACK_ENV} env view regenerate /opt/local ...@@ -230,6 +230,18 @@ spack -e ${SPACK_ENV} env view regenerate /opt/local
spack -e ${SPACK_ENV} env view regenerate /opt/detector spack -e ${SPACK_ENV} env view regenerate /opt/detector
EOF EOF
## ensure /opt/local is the view, not a symlink
RUN <<EOF
set -ex
rm -rf /opt/local /opt/detector
LOCAL_PREFIX_PATH=$(realpath $(ls /opt/._local/ | tail -n1))
mv /opt/._local/${LOCAL_PREFIX_PATH} /opt/local
ln -s /opt/local /opt/._local/${LOCAL_PREFIX_PATH}
DETECTOR_PREFIX_PATH=$(realpath $(ls /opt/._detector/ | tail -n1))
mv /opt/._detector/${DETECTOR_PREFIX_PATH} /opt/detector
ln -s /opt/detector /opt/._detector/${DETECTOR_PREFIX_PATH}
EOF
## Place cvmfs catalogs ## Place cvmfs catalogs
RUN <<EOF RUN <<EOF
touch ${SPACK_ROOT}/.cvmfscatalog touch ${SPACK_ROOT}/.cvmfscatalog
...@@ -283,52 +295,6 @@ for t in ${target[*]} ; do ...@@ -283,52 +295,6 @@ for t in ${target[*]} ; do
done done
EOF EOF
## make sure we have the entrypoints setup correctly
ENTRYPOINT []
CMD ["bash", "--rcfile", "/etc/profile", "-l"]
USER 0
WORKDIR /
## ========================================================================================
## STAGE 2
## Lean target image
## ========================================================================================
FROM ${DOCKER_REGISTRY}${RUNTIME_IMAGE}:${INTERNAL_TAG} as runtime
ARG TARGETPLATFORM
LABEL maintainer="Sylvester Joosten <sjoosten@anl.gov>" \
name="jug_xl" \
march="$TARGETPLATFORM"
## copy over everything we need from builder
COPY --from=builder /opt/spack /opt/spack
COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software
COPY --from=builder /opt/._local /opt/._local
COPY --from=builder /opt/._detector /opt/._detector
COPY --from=builder /etc/profile.d /etc/profile.d
COPY --from=builder /etc/jug_info /etc/jug_info
COPY --from=builder /etc/eic-env.sh /etc/eic-env.sh
COPY --from=builder /.singularity.d /.singularity.d
COPY --from=builder /usr/bin/docker-shell /usr/bin/docker-shell
## Use spack entrypoint. NOTE: Requires `set -ex` in all multi-line scripts!
ENV SPACK_ROOT=/opt/spack
SHELL ["docker-shell"]
## ensure /opt/local is the view, not a symlink
RUN <<EOF
set -ex
rm -rf /opt/local /opt/detector
LOCAL_PREFIX_PATH=$(realpath $(ls /opt/._local/ | tail -n1))
mv /opt/._local/${LOCAL_PREFIX_PATH} /opt/local
ln -s /opt/local /opt/._local/${LOCAL_PREFIX_PATH}
DETECTOR_PREFIX_PATH=$(realpath $(ls /opt/._detector/ | tail -n1))
mv /opt/._detector/${DETECTOR_PREFIX_PATH} /opt/detector
ln -s /opt/detector /opt/._detector/${DETECTOR_PREFIX_PATH}
EOF
## set ROOT TFile forward compatibility ## set ROOT TFile forward compatibility
RUN sed --in-place --follow-symlinks 's/# \(TFile.v630forwardCompatibility:\) no/\1 yes/' /opt/local/etc/root/system.rootrc RUN sed --in-place --follow-symlinks 's/# \(TFile.v630forwardCompatibility:\) no/\1 yes/' /opt/local/etc/root/system.rootrc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment