Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions konflux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25
COPY . /workspace
WORKDIR /workspace

# Version information (OADP_VERSION avoids collision with Konflux-injected VERSION)
ARG OADP_VERSION=dev
ARG GIT_COMMIT=unknown

# Build release binaries for all platforms (CGO_ENABLED=0 for cross-platform
# portability — CLI binaries run on user machines outside the FIPS boundary)
#
# Version info: prefer ART-injected BUILD_VERSION/SOURCE_GIT_COMMIT env vars
# (set by doozer in Konflux builds), fall back to defaults for local builds.
RUN set -e && \
OADP_VERSION="${BUILD_VERSION:-dev}" && \
OADP_GIT_COMMIT="${SOURCE_GIT_COMMIT:-unknown}" && \
mkdir -p /archives && \
for platform in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64; do \
os=$(echo $platform | cut -d'/' -f1) && \
Expand All @@ -23,12 +24,12 @@ RUN set -e && \
else \
output="kubectl-oadp_${os}_${arch}"; \
fi && \
echo "Building $output..." && \
echo "Building $output (version=${OADP_VERSION})..." && \
CGO_ENABLED=0 GOOS=$os GOARCH=$arch \
go build -trimpath -mod=mod \
-ldflags="-s -w \
-X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${OADP_VERSION} \
-X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA=${GIT_COMMIT} \
-X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA=${OADP_GIT_COMMIT} \
-X github.com/vmware-tanzu/velero/pkg/buildinfo.GitTreeState=clean" \
-o /archives/$output \
. && \
Expand Down
Loading