Compare commits

..
Author SHA1 Message Date
marvin d034c8b5ce Add .containerignore: minimal build context
CI / build (pull_request) Successful in 14s
Deny-all with explicit allows (Cargo files, src/, init/, kernel/config).
Previously the full linux submodule was shipped into every build context.
2026-10-20 17:13:09 +02:00
marvin 26ba83e7e3 Add Containerfile: build boco (musl) and the slim kernel; runnable runner image
CI / build (pull_request) Successful in 13s
- 3-stage build: musl boco+boco-init (needs rust>=1.88, alpine:edge),
  linux-7.2 bzImage from kernel/config (pinned tarball, sha256-verified),
  slim runtime with qemu/virtiofsd/podman.
- Verified end-to-end: kernel boots under KVM, ext4 rootfs, userspace init.
- NOTE: nested rootless podman cannot 'podman unshare -> container mount'
  (build path); boot path works as-is.
2026-10-20 17:04:10 +02:00
+3 -2
View File
@@ -23,11 +23,11 @@ RUN cargo build --release -p boco -p boco-init \
FROM alpine:3.22 AS kernel FROM alpine:3.22 AS kernel
# g++ for host tools, libelf for objtool, openssl for extract-cert # g++ for host tools, libelf for objtool, openssl for extract-cert
RUN apk add --no-cache make gcc g++ musl-dev perl flex bison bc \ RUN apk add --no-cache make gcc g++ musl-dev perl flex bison bc \
elfutils-dev openssl-dev findutils tar xz zstd curl linux-headers diffutils elfutils-dev openssl-dev findutils tar xz zstd curl linux-headers
WORKDIR /kbuild WORKDIR /kbuild
# Pinned upstream tarball: linux-7.2.tar.xz, sha256 # Pinned upstream tarball: linux-7.2.tar.xz, sha256
# f9fef3d14c0df53819026f4be74459835c2a0b0dcbf5b5bbd9ea19f0829402b3. # f9fef3d14c0df53819026f4be74459835c2a0b0dcbf5b5bbd9ea19f0829402b3.
# (Equivalent to the upstream shallow pin 8d3ae59288f1e7d58d76558a6ee96d533bc5019f # (Equivalent to user's shallow pin 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
# = refs/tags/v7.2{} — verified via `git ls-remote`; the tarball avoids # = refs/tags/v7.2{} — verified via `git ls-remote`; the tarball avoids
# a multi-GB shallow clone through flaky slirp NAT.) # a multi-GB shallow clone through flaky slirp NAT.)
RUN curl -fsSLo /tmp/linux-7.2.tar.xz https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.tar.xz \ RUN curl -fsSLo /tmp/linux-7.2.tar.xz https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.tar.xz \
@@ -60,6 +60,7 @@ COPY --from=build /src/target/release/boco-init /home/boco/.local/share/boco/boc
COPY --from=kernel /vmlinuz /home/boco/.local/share/boco/vmlinuz COPY --from=kernel /vmlinuz /home/boco/.local/share/boco/vmlinuz
RUN chmod 755 /usr/local/bin/boco /home/boco/.local/share/boco/boco-init /home/boco/.local/share/boco/vmlinuz RUN chmod 755 /usr/local/bin/boco /home/boco/.local/share/boco/boco-init /home/boco/.local/share/boco/vmlinuz
ENV XDG_DATA_HOME=/home/boco/.local/share ENV XDG_DATA_HOME=/home/boco/.local/share
ENV XDG_DATA_HOME=/home/boco/.local/share
WORKDIR /data WORKDIR /data
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["image", "list"] CMD ["image", "list"]