From 0138b7c970d6826acae189d197eb76b36ba07690 Mon Sep 17 00:00:00 2001 From: Julian <115516918+juliansommer@users.noreply.github.com> Date: Fri, 23 Jan 2026 11:26:33 +1000 Subject: [PATCH] move image download to before deps layer --- tests/e2e/Dockerfile.e2e | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/e2e/Dockerfile.e2e b/tests/e2e/Dockerfile.e2e index c87926630..9d1200ad4 100644 --- a/tests/e2e/Dockerfile.e2e +++ b/tests/e2e/Dockerfile.e2e @@ -23,6 +23,18 @@ ENV PATH="/usr/local/go/bin:/root/go/bin:${PATH}" # Set up working directory structure to match development layout WORKDIR /root/Development/mulga +# Pre-download Ubuntu cloud image for e2e tests (cached in Docker layer) +# Placed before dependency copy so go.mod changes don't invalidate this layer +RUN mkdir -p /root/images && \ + ARCH=$(dpkg --print-architecture) && \ + if [ "$ARCH" = "amd64" ]; then \ + curl -L -o /root/images/ubuntu-24.04.img \ + https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img; \ + elif [ "$ARCH" = "arm64" ]; then \ + curl -L -o /root/images/ubuntu-24.04.img \ + https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img; \ + fi + # 1. Pre-copy dependency manifests for cache layer COPY hive/go.mod hive/go.sum ./hive/ COPY viperblock/go.mod viperblock/go.sum ./viperblock/ @@ -38,18 +50,6 @@ RUN --mount=type=cache,target=/root/go/pkg/mod \ (cd viperblock/nbd/libguestfs.org/nbdkit && go mod download) && \ (cd predastore && go mod download) -# Pre-download Ubuntu cloud image for e2e tests (cached in Docker layer) -# Placed before source copy so code changes don't invalidate this layer -RUN mkdir -p /root/images && \ - ARCH=$(dpkg --print-architecture) && \ - if [ "$ARCH" = "amd64" ]; then \ - curl -L -o /root/images/ubuntu-24.04.img \ - https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img; \ - elif [ "$ARCH" = "arm64" ]; then \ - curl -L -o /root/images/ubuntu-24.04.img \ - https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img; \ - fi - # 3. Copy the rest of the source code COPY hive/ ./hive/ COPY viperblock/ ./viperblock/