-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathContainerfile
More file actions
34 lines (31 loc) · 1.47 KB
/
Containerfile
File metadata and controls
34 lines (31 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This builds the final OCP/OKD node image on top of the base CoreOS image. For
# instructions on how to build this, see `docs/building.md`.
ARG IMAGE_FROM=overridden
FROM ${IMAGE_FROM} as build
ARG OPENSHIFT_CI=0
RUN --mount=type=bind,target=/run/src --mount=type=secret,id=yumrepos,target=/etc/yum.repos.d/secret.repo /run/src/build-node-image.sh
FROM build as metadata
ARG IMAGE_NAME
ARG IMAGE_CPE
ARG TARGETARCH
RUN --mount=type=bind,target=/run/src /run/src/scripts/generate-metadata
RUN --mount=type=bind,target=/run/src /run/src/scripts/generate-labels
FROM build
COPY --from=metadata /usr/share/buildinfo /usr/share/buildinfo
# Copy in the meta.json. This needs to be the last operation that
# creates a layer in the image build so that our `oc image extract img[-1]`
# trick works. See https://github.com/coreos/fedora-coreos-pipeline/blob/80c2625b89185f8adc5568fae112484a427c5806/utils.groovy#L1004
COPY --from=metadata /usr/share/openshift /usr/share/openshift
ARG IMAGE_NAME
ARG IMAGE_CPE
ARG TARGETARCH
LABEL name=${IMAGE_NAME}
LABEL cpe=${IMAGE_CPE}
LABEL architecture=${TARGETARCH}
LABEL io.openshift.metalayer=true
# Add a hack to get OpenShift tests working again because a
# revert of the new architecture happened in
# https://github.com/openshift/machine-config-operator/pull/5703
# because we can't add labels to the rhel-10.2 yet:
# https://github.com/coreos/rhel-coreos-config/blob/1ba124d37b93a095bb5ec2ef5b421965b982b255/build-args-rhel-10.2.conf#L15-L18
LABEL ostree.linux=true