-
Notifications
You must be signed in to change notification settings - Fork 204
How to make an image with docker build inside
#1432
-
I am trying to install Dataiku using bootc instead of a VM. The end goal is to run the resulting qcow2 on qemu/kvm.
This requires a couple of docker build commands inside of the qcow2 since the resulting VM will need to have docker images loaded in the container runtime.
It seems like this isn't supposed to work in bootc. Because I'm using this minimalist Dockerfile:
FROM quay.io/fedora/fedora-bootc:42 # Install Docker and Python RUN microdnf install -y \ docker \ && microdnf clean all RUN systemctl enable docker.service WORKDIR /opt COPY Dockerfile.tmp /opt/Dockerfile RUN docker build -t sample-image .
The Dockerfile.tmp isn't important it's just a FROM alpine and apk add curl
This gives the error:
------ > [6/7] RUN docker build -t sample-image .: 0.151 ERROR: mkdir /root: file exists ------ Dockerfile:16 -------------------- 14 | COPY Dockerfile.tmp /opt/Dockerfile 15 | 16 | >>> RUN docker build -t sample-image . 17 | 18 | # Optional: Create a dummy file to indicate build success -------------------- ERROR: failed to solve: process "/bin/sh -c docker build -t sample-image ." did not complete successfully: exit code: 1
This is quite cryptic, but I imagine it is due to the fact that the socket isn't loaded in bootc during build. I also tried buildah which doesn't work either maybe because it needs user namespace which is not available in bootc building runtime.
Is there any way to do what I need to do?
The option of building the image outside the bootc then loading its layers isn't much of an option either, because building said image requires the entire context and that's not something I want on the host.
Beta Was this translation helpful? Give feedback.