|
| 1 | +FROM quay.io/fedora/fedora:42 as builder |
| 2 | + |
| 3 | +ENV URL https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images |
| 4 | +ENV IMAGE Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2 |
| 5 | +ENV CHECKSUM Fedora-Cloud-42-1.1-x86_64-CHECKSUM |
| 6 | +ENV LIBGUESTFS_BACKEND direct |
| 7 | + |
| 8 | +RUN dnf install -y curl libguestfs guestfs-tools curl |
| 9 | + |
| 10 | +RUN curl -L -O $URL/$IMAGE \ |
| 11 | + && curl -L -O $URL/$CHECKSUM \ |
| 12 | + && curl -O https://fedoraproject.org/fedora.gpg \ |
| 13 | + && gpgv --keyring ./fedora.gpg $CHECKSUM \ |
| 14 | + && sha256sum --ignore-missing -c $CHECKSUM \ |
| 15 | + && mv $IMAGE /disk.img |
| 16 | + |
| 17 | +RUN mkdir -p /systemd-services |
| 18 | +COPY ./podman-vsock-proxy.service /systemd-services/podman-vsock-proxy.service |
| 19 | +RUN virt-copy-in -a /disk.img /systemd-services/* /etc/systemd/system |
| 20 | + |
| 21 | +# Configuration of the guest image |
| 22 | +RUN virt-customize -a /disk.img --install socat,podman \ |
| 23 | + --root-password password:bootc \ |
| 24 | + --run-command "sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config" \ |
| 25 | + --run-command "mkdir -p /usr/lib/bootc/config" \ |
| 26 | + --run-command "echo \"config /usr/lib/bootc/config virtiofs rw,relatime,nofail 0 0\" >> /etc/fstab" \ |
| 27 | + --run-command "mkdir -p /usr/lib/bootc/storage" \ |
| 28 | + --run-command "echo \"storage /usr/lib/bootc/storage virtiofs rw,relatime,nofail 0 0\" >> /etc/fstab" \ |
| 29 | + --run-command "mkdir -p /usr/lib/bootc/output" \ |
| 30 | + --run-command "echo \"output /var/lib/bootc/output virtiofs rw,relatime,nofail 0 0\" >> /etc/fstab" \ |
| 31 | + --run-command "systemctl enable podman.socket" \ |
| 32 | + --run-command "systemctl enable podman-vsock-proxy" \ |
| 33 | + --run-command "sed -i '/^additionalimagestores = \[/a\ \"/usr/lib/bootc/storage\",' /usr/share/containers/storage.conf" \ |
| 34 | + --run-command "dnf clean all -y" \ |
| 35 | + && virt-sparsify --in-place /disk.img |
| 36 | + |
| 37 | +FROM scratch |
| 38 | +COPY --from=builder /disk.img /disk.img |
0 commit comments