mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-20 11:21:49 +00:00
move image download to before deps layer
This commit is contained in:
+12
-12
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user