Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
PentesterPriyanshu authored Oct 28, 2024
1 parent 13b3d82 commit 0ab11a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docker/sandbox-bundled/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/ ./
Expand All @@ -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" ]
Expand Down

0 comments on commit 0ab11a6

Please sign in to comment.