-
Notifications
You must be signed in to change notification settings - Fork 113
/
Dockerfile
73 lines (60 loc) · 2.76 KB
/
Dockerfile
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
63
64
65
66
67
68
69
70
71
72
73
## Build iPXE w/ IPv6 Support
## Note: we are pinning to a specific commit for reproducible builds.
## Updated as needed.
FROM docker.io/centos:centos8 AS builder
RUN dnf install -y gcc git make xz-devel
WORKDIR /tmp
COPY . .
RUN git clone https://github.com/ipxe/ipxe.git && \
cd ipxe && \
git checkout 3fe683ebab29afacf224e6b0921f6329bebcdca7 && \
cd src && \
sed -i -e "s/#undef.*NET_PROTO_IPV6/#define NET_PROTO_IPV6/g" config/general.h && \
make bin/undionly.kpxe bin-x86_64-efi/ipxe.efi bin-x86_64-efi/snponly.efi
## TODO(TheJulia): At some point we may want to try and make the size
## of the ESP image file to be sized smaller for the files that need to
## be copied in, however that requires more advanced scripting beyond
## an MVP.
RUN if [ $(uname -m) = "x86_64" ]; then \
dnf install -y genisoimage grub2 grub2-efi-x64 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 && \
mcopy -i esp.img -v /boot/efi/EFI/BOOT/BOOTX64.EFI ::EFI/BOOT && \
mcopy -i esp.img -v /boot/efi/EFI/centos/grubx64.efi ::EFI/BOOT && \
mdir -i esp.img ::EFI/BOOT; \
else \
touch /tmp/esp.img; \
fi
FROM docker.io/centos:centos8
ENV PKGS_LIST=main-packages-list.txt
ARG EXTRA_PKGS_LIST
ARG PATCH_LIST
COPY ${PKGS_LIST} ${EXTRA_PKGS_LIST} ${PATCH_LIST} /tmp/
COPY prepare-image.sh patch-image.sh /bin/
RUN prepare-image.sh && \
rm -f /bin/prepare-image.sh
COPY --from=builder /tmp/ipxe/src/bin/undionly.kpxe /tmp/ipxe/src/bin-x86_64-efi/snponly.efi /tmp/ipxe/src/bin-x86_64-efi/ipxe.efi /tftpboot/
COPY --from=builder /tmp/esp.img /tmp/uefi_esp.img
COPY ./ironic.conf.j2 /etc/ironic/ironic.conf.j2
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
COPY ./runlogwatch.sh /bin/runlogwatch.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.j2 /tmp/inspector.ipxe.j2
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"]