Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions images/baremetal/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ FROM registry.ci.openshift.org/ocp/5.0:hyperkube AS kas
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder
ARG TAGS="baremetal fipscapable"
ARG SKIP_ENVTEST="y"
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
Comment on lines +11 to +12

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried that it will shadow the ART-injected ENV in ART builds:

ART's build tooling (doozer) modifies the Dockerfile during a "rebase" step before the image is built. In doozer/doozerlib/backend/rebaser.py, it builds a set of environment variables that include BUILD_VERSION:python

build_update_env_vars = {
    'OS_GIT_MAJOR': major_version,
    'OS_GIT_MINOR': minor_version,
    ...
    'BUILD_VERSION': version,
    'BUILD_RELEASE': release if release else '',
}

These get injected as an ENV instruction (flagged with __doozer=update) into each build stage of the Dockerfile — right after the FROM line. A real ART build log shows this in action:

ENV __doozer=update BUILD_RELEASE=202508131058.p2.gc736eb7.assembly.test.el9 \
    BUILD_VERSION=v4.20.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=20 ..

Maybe we need a differently named build arg / envvar and have something like this somewhere?

BUILD_VERSION=${BUILD_VERSION:-BUILD_$VERSION_BUILD_ARG}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petr-muller I see. I will be on PTO for a few days, so I've let the rest of my team know and given them access so they can update this PR (or of course start a new one in place of this one, which is just as well).

WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=etcd /usr/bin/etcd /usr/bin/etcd
Expand Down
8 changes: 8 additions & 0 deletions images/installer-artifacts/Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FROM registry.ci.openshift.org/ocp/5.0:installer-etcd-artifacts AS etcd-artifact
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS macbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/darwin/amd64 cluster-api/bin/darwin_amd64
Expand All @@ -19,6 +21,8 @@ RUN GOOS=darwin GOARCH=amd64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS macarmbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/darwin/arm64 cluster-api/bin/darwin_arm64
Expand All @@ -28,6 +32,8 @@ RUN GOOS=darwin GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS linuxbuilder
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/linux/amd64 cluster-api/bin/linux_amd64
Expand All @@ -38,6 +44,8 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS l
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/linux/arm64 cluster-api/bin/linux_arm64
Expand Down
2 changes: 2 additions & 0 deletions images/installer/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS b
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/ cluster-api/bin/
Expand Down
2 changes: 2 additions & 0 deletions images/installer/Dockerfile.upi.ci
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS b
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/ cluster-api/bin/
Expand Down
2 changes: 2 additions & 0 deletions images/libvirt/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ FROM registry.ci.openshift.org/ocp/4.17:hyperkube AS kas
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder
ARG TAGS="libvirt fipscapable"
ARG SKIP_ENVTEST="y"
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=etcd /usr/bin/etcd /usr/bin/etcd
Expand Down
2 changes: 2 additions & 0 deletions images/openstack/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS b
ENV GO_COMPLIANCE_EXCLUDE=".*"
ARG TAGS=""
ARG SKIP_ENVTEST="y"
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=kas-artifacts /usr/share/openshift/ cluster-api/bin/
Expand Down