-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathDockerfile.ci
More file actions
51 lines (44 loc) · 2.1 KB
/
Copy pathDockerfile.ci
File metadata and controls
51 lines (44 loc) · 2.1 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This Dockerfile is a used by CI to publish an installer image for creating libvirt clusters
# It builds an image containing openshift-install and nss-wrapper for remote deployments, as well as the google cloud-sdk for nested GCE environments and
# oc for getting assets from an existing cluster to spin up multi-architecture compute clusters on libvirt.
# The binaries in these images are dynamically linked
FROM registry.ci.openshift.org/ocp/4.17:etcd AS etcd
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"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=etcd /usr/bin/etcd /usr/bin/etcd
COPY --from=kas /usr/bin/kube-apiserver /usr/bin/kube-apiserver
RUN mkdir -p cluster-api/bin/$(go env GOOS)_$(go env GOHOSTARCH) && \
mv /usr/bin/etcd /usr/bin/kube-apiserver -t cluster-api/bin/$(go env GOOS)_$(go env GOHOSTARCH)/
RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
FROM registry.ci.openshift.org/ocp/4.17:cli as cli
FROM quay.io/multi-arch/yq:3.3.0 as yq3
FROM quay.io/multi-arch/yq:4.30.5 as yq4
FROM quay.io/centos/centos:stream9
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install
COPY --from=builder /go/src/github.com/openshift/installer/images/libvirt/mock-nss.sh /bin/mock-nss.sh
COPY --from=builder /go/src/github.com/openshift/installer/images/libvirt/google-cloud-sdk.repo /etc/yum.repos.d/google-cloud-sdk.repo
COPY --from=cli /usr/bin/oc /bin/oc
RUN yum update -y && \
yum install --setopt=tsflags=nodocs -y \
genisoimage \
gettext \
google-cloud-sdk \
libvirt-client \
libvirt-libs \
nss_wrapper \
openssh-clients \
virt-install \
qemu-kvm && \
yum clean all && rm -rf /var/cache/yum/*
COPY --from=yq3 /yq /bin/yq-go
COPY --from=yq4 /usr/bin/yq /bin/yq-v4
# This symlink is provided for backwards compatibility
RUN ln -s /bin/yq-go /bin/yq && chmod +x /bin/yq
RUN mkdir /output && chown 1000:1000 /output
USER 1000:1000
ENV HOME /output
WORKDIR /output