github.com/openshift/installer@v1.4.17/images/openstack/Dockerfile.ci (about) 1 # This Dockerfile is used by CI to test using OpenShift Installer against an OpenStack cloud. 2 # It builds an image containing the openshift-install command as well as the openstack cli. 3 FROM registry.ci.openshift.org/ocp/4.17:installer-terraform-providers as providers 4 # We copy from the -artifacts images because they are statically linked 5 FROM registry.ci.openshift.org/ocp/4.17:installer-kube-apiserver-artifacts AS kas-artifacts 6 FROM registry.ci.openshift.org/ocp/4.17:installer-etcd-artifacts AS etcd-artifacts 7 8 FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS builder 9 # FIPS support is offered via the baremetal-installer image 10 ENV GO_COMPLIANCE_EXCLUDE=".*" 11 ARG TAGS="" 12 ARG SKIP_ENVTEST="y" 13 WORKDIR /go/src/github.com/openshift/installer 14 COPY . . 15 COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/ 16 COPY --from=kas-artifacts /usr/share/openshift/ cluster-api/bin/ 17 COPY --from=etcd-artifacts /usr/share/openshift/ cluster-api/bin/ 18 RUN mkdir -p cluster-api/bin/$(go env GOOS)_$(go env GOHOSTARCH) && \ 19 mv cluster-api/bin/$(go env GOOS)/$(go env GOHOSTARCH)/* -t cluster-api/bin/$(go env GOOS)_$(go env GOHOSTARCH)/ 20 RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh 21 22 FROM registry.ci.openshift.org/ocp/4.17:cli AS cli 23 24 FROM registry.ci.openshift.org/ocp/4.17:base-rhel9 25 COPY --from=cli /usr/bin/oc /bin/oc 26 COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install 27 COPY --from=builder /go/src/github.com/openshift/installer/upi/openstack /var/lib/openshift-install/upi 28 COPY --from=builder /go/src/github.com/openshift/installer/docs/user/openstack /var/lib/openshift-install/docs 29 COPY --from=builder /go/src/github.com/openshift/installer/hack/openstack/test-manifests.sh /go/src/github.com/openshift/installer/scripts/openstack/manifest-tests /var/lib/openshift-install/manifest-tests 30 31 # Install Dependendencies for tests 32 # https://github.com/openshift/origin/blob/6114cbc507bf18890f009f16ee424a62007bc390/images/tests/Dockerfile.rhel 33 RUN yum update -y && \ 34 yum install --setopt=tsflags=nodocs -y gettext make git gzip util-linux glibc-locale-source python3-pip unzip jq nmap && \ 35 yum clean all && rm -rf /var/cache/yum/* && \ 36 localedef -c -f UTF-8 -i en_US en_US.UTF-8 && \ 37 git config --system user.name test && \ 38 git config --system user.email test@example.com && \ 39 chmod g+w /etc/passwd 40 41 # ansible 2.9 is EOL in September 2023, so we need to install ansible-core and get the collections from source 42 # until we have a package available. 43 RUN python3 -m pip install ansible-core 44 RUN ansible-galaxy collection install openstack.cloud ansible.utils community.general && \ 45 mkdir -p /usr/share/ansible/collections/ansible_collections && \ 46 cp -r /root/.ansible/collections/ansible_collections/* /usr/share/ansible/collections/ansible_collections/ 47 48 # ansible-core comes with python3.8 but openstacksdk comes with python3.6 so let's install them from pip. 49 RUN python3 -m pip install yq openstackclient openstacksdk netaddr 50 51 # The Continuous Integration machinery relies on Route53 for DNS while testing the cluster. 52 RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ 53 unzip awscliv2.zip && \ 54 ./aws/install -b /bin && \ 55 rm -rf ./aws awscliv2.zip 56 57 RUN mkdir /output && chown 1000:1000 /output 58 USER 1000:1000 59 ENV PATH /bin:/usr/local/bin 60 ENV HOME /output 61 ENV LC_ALL en_US.UTF-8 62 WORKDIR /output 63 ENTRYPOINT ["/bin/openshift-install"]