diff --git a/containers/jug/xl.Dockerfile b/containers/jug/xl.Dockerfile
index ce9195819f1de83b9875b3526974be15d10a1dcd..1ecf87156803c92f0e408e79fe4ec0b683924c09 100644
--- a/containers/jug/xl.Dockerfile
+++ b/containers/jug/xl.Dockerfile
@@ -21,14 +21,13 @@ ARG JUG_VERSION=1
 RUN cd /tmp                                                                     \
  && echo " - jug_xl: ${JUG_VERSION}" >> /etc/jug_info
 
-ENV CCACHE_DIR=/ccache/$TARGETPLATFORM
-
 ADD ${EICWEB}/369/repository/tree?ref=${JUGGLER_VERSION} /tmp/369.json
 RUN --mount=type=cache,target=/ccache/                                          \
     cd /tmp                                                                     \
  && echo "INSTALLING JUGGLER"                                                   \
  && git clone -b ${JUGGLER_VERSION} --depth 1                                   \
         https://eicweb.phy.anl.gov/EIC/juggler.git                              \
+ && export CCACHE_DIR=/ccache/$TARGETPLATFORM                                   \     
  && cmake -B build -S juggler                                                   \
           -DCMAKE_CXX_FLAGS="-Wno-psabi"                                        \
           -DCMAKE_CXX_STANDARD=17                                               \
@@ -48,6 +47,7 @@ RUN --mount=type=cache,target=/ccache/
  && echo "INSTALLING EICRECON"                                                  \
  && git clone -b ${EICRECON_VERSION} --depth 1                                  \
         https://github.com/eic/eicrecon.git                                     \
+ && export CCACHE_DIR=/ccache/$TARGETPLATFORM                                   \
  && cmake -B build -S eicrecon                                                  \
           -DCMAKE_CXX_FLAGS="-Wno-psabi"                                        \
           -DCMAKE_CXX_STANDARD=17                                               \
@@ -132,6 +132,7 @@ COPY setup_detectors.py /tmp
 COPY detectors.yaml /tmp
 RUN --mount=type=cache,target=/ccache/                                          \
     cd /tmp                                                                     \
+ && export CCACHE_DIR=/ccache/$TARGETPLATFORM                                   \
  && [ "z$NIGHTLY" = "z1" ] && NIGHTLY_FLAG="--nightly" || NIGHTLY_FLAG=""       \
  && /tmp/setup_detectors.py --prefix /opt/detector --config /tmp/detectors.yaml \
                          $NIGHTLY_FLAG                                          \