File Dockerfile of Package ironic
# SPDX-License-Identifier: MIT
#!BuildTag: suse/ironic:%%openstack-ironic_version%%
#!BuildTag: suse/ironic:latest
#!BuildVersion: 15.4
FROM suse/sle15:15.4 as ironic-builder
MAINTAINER SUSE LLC (https://www.suse.com/)
# Define labels according to https://en.opensuse.org/Building_derived_containers
LABEL org.opencontainers.image.title="SLE Openstack Ironic Container Image"
LABEL org.opencontainers.image.description="Openstack Ironic based on the SLE Base Container Image."
LABEL org.opencontainers.image.url="https://www.suse.com/products/server/"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opencontainers.image.version="%%openstack-ironic_version%%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="techpreview"
LABEL com.suse.eula="sle-bci"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle"
LABEL com.suse.image-type="application"
LABEL com.suse.release-stage="released"
# endlabelprefix
RUN set -euo pipefail; zypper -n in --no-recommends gcc git make xz-devel shim dosfstools mtools glibc-extra grub2-x86_64-efi grub2; zypper -n clean; rm -rf /var/log/*
WORKDIR /tmp
COPY prepare-efi.sh /bin/
RUN set -euo pipefail; chmod +x /bin/prepare-efi.sh
RUN /bin/prepare-efi.sh
FROM suse/sle15:15.4
ENV GRUB_DIR=/tftpboot/boot/grub
RUN sed -i -e 's%^# rpm.install.excludedocs = no.*%rpm.install.excludedocs = yes%g' /etc/zypp/zypp.conf
# install python3.9 and required tools
RUN set -euo pipefail; zypper -n in --no-recommends python39-devel python39 python39-pip git curl; zypper -n clean; rm -rf /var/log/*
RUN set -euo pipefail; ln -s /usr/bin/python3.9 /usr/local/bin/python3; \
ln -s /usr/bin/pydoc3.9 /usr/local/bin/pydoc
RUN set -euo pipefail; zypper -n in --no-recommends sles-release tar gzip vim gawk dnsmasq dosfstools apache2 apache2-mod_wsgi inotify-tools ipcalc ipmitool iproute2 procps qemu-tools sqlite3 util-linux xorriso tftp syslinux ipxe-bootimgs
RUN set -euo pipefail; zypper -n in --no-recommends python39-sushy-tools crudini python-dracclient python39-sushy-oem-idrac python39-proliantutils python39-sushy openstack-ironic openstack-ironic-inspector-api
RUN set -euo pipefail; zypper -n in --no-recommends python3-ironicclient; zypper -n clean;
# workaround for mkisofs command failing
RUN echo 'alias mkisofs="xorriso -as mkisofs"' >> ~/.bashrc
COPY mkisofs_wrapper /usr/bin/mkisofs
RUN set -euo pipefail; chmod +x /usr/bin/mkisofs
COPY configure-coreos-ipa configure-ironic.sh ironic-common.sh runhttpd runironic-api runironic-exporter runlogwatch.sh configure-httpd-ipa.sh coreos-ipa-common.sh rundnsmasq runironic runironic-conductor runironic-inspector tls-common.sh configure-nonroot.sh /bin/
RUN set -euo pipefail; chmod +x /bin/configure-coreos-ipa; chmod +x /bin/configure-ironic.sh; chmod +x /bin/ironic-common.sh; chmod +x /bin/runhttpd; chmod +x /bin/runironic-api; chmod +x /bin/runironic-exporter; chmod +x /bin/runlogwatch.sh; chmod +x /bin/configure-httpd-ipa.sh; chmod +x /bin/coreos-ipa-common.sh; chmod +x /bin/rundnsmasq; chmod +x /bin/runironic; chmod +x /bin/runironic-conductor; chmod +x /bin/runironic-inspector; chmod +x /bin/tls-common.sh; chmod +x /bin/configure-nonroot.sh
RUN mkdir -p /tftpboot
RUN mkdir -p $GRUB_DIR
# No need to support the Legacy BIOS boot
#RUN cp /usr/share/syslinux/pxelinux.0 /tftpboot
#RUN cp /usr/share/syslinux/chain.c32 /tftpboot/
RUN cp /usr/share/ipxe/undionly.kpxe /tftpboot/undionly.kpxe
RUN cp /usr/share/ipxe/ipxe-x86_64.efi /tftpboot/ipxe.efi
COPY --from=ironic-builder /tmp/esp.img /tmp/uefi_esp.img
COPY ironic.conf.j2 /etc/ironic/
COPY dnsmasq.conf.j2 /etc/
COPY inspector.ipxe.j2 ironic-python-agent.ign.j2 /tmp/
COPY httpd-ironic-api.conf.j2 /etc/httpd-ironic-api.conf.j2
COPY httpd-vmedia.conf.j2 /etc/httpd-vmedia.conf.j2
# IRONIC-INSPECTOR #
RUN mkdir -p /var/lib/ironic /var/lib/ironic-inspector && \
sqlite3 /var/lib/ironic/ironic.db "pragma journal_mode=wal" && \
sqlite3 /var/lib/ironic-inspector/ironic-inspector.db "pragma journal_mode=wal" && \
zypper rm -y sqlite3
COPY ironic-inspector.conf.j2 /etc/ironic-inspector/
COPY inspector-apache.conf.j2 /etc/apache2/conf.d/
COPY docroot_shared /tmp/docroot_shared
# Workaround
# Removing the 010-ironic.conf file that comes with the package
RUN rm /etc/ironic/ironic.conf.d/010-ironic.conf
RUN /bin/configure-nonroot.sh && rm -f /bin/configure-nonroot.sh