Skip to content

Commit abfbf4d

Browse files
committed
Dockerfile: Add ARG TAGS=ocp
Allow this ARG to be overriden by builds so that OKD builds may have the correct branding by default without requiring an additional configmap. OKD/SCOS builds pass the build-arg `TAGS=scos`, so `pkg/console/subresource/configmap/brand_okd.go` which has `//go:build !ocp` will be built instead of `pkg/console/subresource/configmap/brand_ocp.go` which has `//go:build ocp`. This change should not affect the OCP build of the console-operator image.
1 parent c758f71 commit abfbf4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Dockerfile.rhel7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
2+
ARG TAGS=ocp
23
WORKDIR /go/src/github.com/openshift/console-operator
34
COPY . .
45
ENV GO_PACKAGE github.com/openshift/console-operator
5-
RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" -tags="ocp" -o console ./cmd/console
6+
RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" -tags="${TAGS}" -o console ./cmd/console
67

78
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
89
RUN useradd console-operator

0 commit comments

Comments
 (0)