diff --git a/containers/jug/dev.Dockerfile b/containers/jug/dev.Dockerfile index 807d5377ce9d394fa75de61df2114d71c14e6536..1ba626777ea0c99e0de567423393416f8804c71d 100644 --- a/containers/jug/dev.Dockerfile +++ b/containers/jug/dev.Dockerfile @@ -230,6 +230,18 @@ spack -e ${SPACK_ENV} env view regenerate /opt/local spack -e ${SPACK_ENV} env view regenerate /opt/detector 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 RUN <<EOF touch ${SPACK_ROOT}/.cvmfscatalog @@ -283,52 +295,6 @@ for t in ${target[*]} ; do done 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 RUN sed --in-place --follow-symlinks 's/# \(TFile.v630forwardCompatibility:\) no/\1 yes/' /opt/local/etc/root/system.rootrc