forked from openshift/ironic-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ocp
63 lines (49 loc) · 2.53 KB
/
Dockerfile.ocp
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
52
53
54
55
56
57
58
59
60
61
62
FROM ironic-builder AS builder
WORKDIR /tmp
## NOTE(derekh): We need to build our own grub image because the one
## that gets installed by grub2-efi-x64 (/boot/efi/EFI/centos/grubx64.efi)
## looks for grub.cnf in /EFI/centos, ironic puts it in /boot/grub
RUN if [ $(uname -m) = "x86_64" ]; then \
dnf install -y gcc git make genisoimage xz-devel grub2 grub2-efi-x64-modules shim dosfstools mtools && \
dd bs=1024 count=3200 if=/dev/zero of=esp.img && \
mkfs.msdos -F 12 -n 'ESP_IMAGE' ./esp.img && \
mmd -i esp.img EFI && \
mmd -i esp.img EFI/BOOT && \
grub2-mkimage -C xz -O x86_64-efi -p /boot/grub -o /tmp/grubx64.efi boot linux search normal configfile part_gpt btrfs ext2 fat iso9660 loopback test keystatus gfxmenu regexp probe efi_gop efi_uga all_video gfxterm font scsi echo read ls cat png jpeg halt reboot && \
mcopy -i esp.img -v /boot/efi/EFI/BOOT/BOOTX64.EFI ::EFI/BOOT && \
mcopy -i esp.img -v /tmp/grubx64.efi ::EFI/BOOT && \
mdir -i esp.img ::EFI/BOOT; \
else \
touch /tmp/esp.img; \
fi
FROM ubi8
COPY ./main-packages-list.txt /tmp/main-packages-list.txt
RUN dnf upgrade -y && \
dnf --setopt=install_weak_deps=False install -y $(cat /tmp/main-packages-list.txt) && \
dnf clean all && \
rm -rf /var/cache/{yum,dnf}/*
COPY ./prepare-ipxe.sh /tmp
RUN chmod +x /tmp/prepare-ipxe.sh && /tmp/prepare-ipxe.sh && rm /tmp/prepare-ipxe.sh
COPY --from=builder /tmp/esp.img /httpboot/uefi_esp.img
COPY ./ironic.conf /tmp/ironic.conf
RUN crudini --merge /etc/ironic/ironic.conf < /tmp/ironic.conf && \
rm /tmp/ironic.conf
COPY ./runironic-api.sh /bin/runironic-api
COPY ./runironic-conductor.sh /bin/runironic-conductor
COPY ./runironic-exporter.sh /bin/runironic-exporter
COPY ./rundnsmasq.sh /bin/rundnsmasq
COPY ./runhttpd.sh /bin/runhttpd
COPY ./runmariadb.sh /bin/runmariadb
COPY ./configure-ironic.sh /bin/configure-ironic.sh
COPY ./ironic-common.sh /bin/ironic-common.sh
# TODO(dtantsur): remove this script when we stop supporting running both
# API and conductor processes via one entry point.
COPY ./runironic.sh /bin/runironic
COPY ./dnsmasq.conf.j2 /etc/dnsmasq.conf.j2
COPY ./inspector.ipxe /tmp/inspector.ipxe
COPY ./dualboot.ipxe /tmp/dualboot.ipxe
# Custom httpd config, removes all but the bare minimum needed modules
RUN rm -f /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.modules.d/*.conf
COPY ./httpd.conf /etc/httpd/conf.d/httpd.conf
COPY ./httpd-modules.conf /etc/httpd/conf.modules.d/httpd-modules.conf
ENTRYPOINT ["/bin/runironic"]