-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break up velero-builder stage to allow more concurrent layer builds.
Signed-off-by: Tiger Kaovilai <[email protected]>
- Loading branch information
Showing
1 changed file
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
# limitations under the License. | ||
|
||
# Velero binary build section | ||
FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS velero-builder | ||
FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS velero-builder-base | ||
|
||
ARG GOPROXY | ||
ARG BIN | ||
|
@@ -41,13 +41,15 @@ RUN go mod download | |
|
||
COPY . /go/src/github.com/vmware-tanzu/velero | ||
|
||
RUN mkdir -p /output/usr/bin && \ | ||
export GOARM=$( echo "${GOARM}" | cut -c2-) && \ | ||
go build -o /output/${BIN} \ | ||
-ldflags "${LDFLAGS}" ${PKG}/cmd/${BIN} && \ | ||
go build -o /output/velero-helper \ | ||
-ldflags "${LDFLAGS}" ${PKG}/cmd/velero-helper && \ | ||
go clean -modcache -cache | ||
RUN mkdir -p /output/usr/bin | ||
|
||
FROM velero-builder-base AS velero-builder-helper | ||
RUN GOARM=$( echo "${GOARM}" | cut -c2-) go build -o /output/velero-helper \ | ||
-ldflags "${LDFLAGS}" ${PKG}/cmd/velero-helper | ||
|
||
FROM velero-builder-base AS velero-builder | ||
RUN GOARM=$( echo "${GOARM}" | cut -c2-) go build -o /output/${BIN} \ | ||
-ldflags "${LDFLAGS}" ${PKG}/cmd/${BIN} | ||
|
||
# Restic binary build section | ||
FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS restic-builder | ||
|
@@ -99,6 +101,8 @@ LABEL maintainer="Xun Jiang <[email protected]>" | |
|
||
COPY --from=velero-builder /output / | ||
|
||
COPY --from=velero-builder-helper /output / | ||
|
||
COPY --from=restic-builder /output / | ||
|
||
USER cnb:cnb | ||
|