diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e0e208e274520baad20cbe62922797db2d019725..12ce40cad99900195b9a687671f515b045bfc61d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -237,11 +237,10 @@ oneapi_jug_dev:default:
     ## calculate a hash based on the spack.yaml file and the spack directory
     ## and use this spack as a docker variable to force a rebuild when there
     ## is a change (versus rerun from cache)
-    - PACKAGE_HASH=$(tar cf - spack* | sha1sum | head -c40)
+    - PACKAGE_HASH=$(sha1sum spack.yam | head -c40)
     - echo "PACKAGE_HASH= ${PACKAGE_HASH}"
-    ## Copy spack directory and spack.yaml into build context
-    - cp -r spack containers/oneapi/
-    - cp spack.yaml containers/oneapi/spack/spack.yaml
+    ## Copy spack.yaml into build context
+    - cp spack.yaml containers/oneapi/spack.yaml
     - CACHE_FLAG=""
     - |
       if [ $FORCE_NOCACHE = 1 ]; then