From 0ab11a6127998e24c6feb78f0a6ef70accebd100 Mon Sep 17 00:00:00 2001 From: Priyanshu Prajapati Date: Mon, 28 Oct 2024 14:30:06 +0530 Subject: [PATCH] Update Dockerfile these changes help make the build faster by optimizing Docker's layer caching Setting TARGETARCH=amd64 as a default ensures that the build does not fai Signed-off-by: Priyanshu Prajapati --- docker/sandbox-bundled/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/sandbox-bundled/Dockerfile b/docker/sandbox-bundled/Dockerfile index 92e8fa2d46..1426083a85 100644 --- a/docker/sandbox-bundled/Dockerfile +++ b/docker/sandbox-bundled/Dockerfile @@ -1,7 +1,9 @@ # syntax=docker/dockerfile:1.4-labs + FROM --platform=${BUILDPLATFORM} mgoltzsche/podman:minimal AS builder -ARG TARGETARCH +# Set architecture with a default fallback +ARG TARGETARCH=amd64 ENV TARGETARCH "${TARGETARCH}" WORKDIR /build @@ -18,6 +20,8 @@ ENV GOARCH "${TARGETARCH}" ENV GOOS linux WORKDIR /flyteorg/build + +# Separate dependency caching step for go modules COPY bootstrap/go.mod bootstrap/go.sum ./ RUN go mod download COPY bootstrap/ ./ @@ -37,12 +41,10 @@ COPY images/tar/${TARGETARCH}/ /var/lib/rancher/k3s/agent/images/ COPY manifests/ /var/lib/rancher/k3s/server/manifests-staging/ COPY bin/ /bin/ -# Install bootstrap COPY --from=bootstrap /flyteorg/build/dist/flyte-sandbox-bootstrap /bin/ VOLUME /var/lib/flyte/storage -# Set environment variable for picking up additional CA certificates ENV SSL_CERT_DIR /var/lib/flyte/config/ca-certificates ENTRYPOINT [ "/bin/k3d-entrypoint.sh" ]