diff --git a/Dockerfile.rhel7 b/Dockerfile.rhel7 index 5eac0cf25..5556e1b1f 100644 --- a/Dockerfile.rhel7 +++ b/Dockerfile.rhel7 @@ -1,8 +1,10 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.18 AS builder +# This pattern is documented in https://github.com/openshift/enhancements/pull/1672. Use ARG to build images based on platform. +ARG TAGS=ocp WORKDIR /go/src/github.com/openshift/cluster-authentication-operator COPY . . ENV GO_PACKAGE github.com/openshift/cluster-authentication-operator -RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" -tags="ocp" -o authentication-operator ./cmd/authentication-operator +RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" -tags="${TAGS}" -o authentication-operator ./cmd/authentication-operator FROM registry.ci.openshift.org/ocp/4.18:base-rhel9 COPY --from=builder /go/src/github.com/openshift/cluster-authentication-operator/authentication-operator /usr/bin/