-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
75 lines (57 loc) · 2.33 KB
/
Copy pathContainerfile
File metadata and controls
75 lines (57 loc) · 2.33 KB
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
74
75
FROM scratch AS ctx
COPY build_files /
# Base Image
FROM quay.io/bootc-devel/fedora-bootc-43-minimal-plus
RUN alternatives --set iptables /usr/sbin/iptables-nft
ARG TARGETOS
ARG TARGETARCH
ARG TARGETPLATFORM
COPY files/ /
# Add brew
COPY --from=ghcr.io/ublue-os/brew:latest /system_files /
RUN /usr/bin/systemctl preset brew-setup.service && \
/usr/bin/systemctl preset brew-update.timer && \
/usr/bin/systemctl preset brew-upgrade.timer
# Guarded copy: only attempt to copy EFI updates if they exist
RUN mkdir -p /usr/lib/bootupd/updates && \
if find /usr/lib/efi -mindepth 3 -maxdepth 3 -type f | read; then \
find /usr/lib/efi -mindepth 3 -maxdepth 3 -type f -exec cp -t /usr/lib/bootupd/updates {} +; \
else \
echo "No EFI updates found, skipping copy"; \
fi
ARG TARGETARCH
ARG TARGETOS
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache \
--mount=type=cache,dst=/var/log \
--mount=type=tmpfs,dst=/tmp \
TARGETOS=$TARGETOS TARGETARCH=$TARGETARCH TARGETPLATFORM=$TARGETPLATFORM \
/ctx/build.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache \
--mount=type=cache,dst=/var/log \
--mount=type=tmpfs,dst=/tmp \
/ctx/hawser.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/var \
--mount=type=tmpfs,dst=/tmp \
/ctx/services.sh
# 1. Run Kernel Script (AMD64 Only)
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/var \
--mount=type=tmpfs,dst=/tmp \
if [ "$TARGETARCH" = "amd64" ]; then /ctx/kernel.sh; else echo "Skipping kernel for $TARGETARCH"; fi
# 2. Run Initramfs Script (AMD64 Only)
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/var \
--mount=type=tmpfs,dst=/tmp \
if [ "$TARGETARCH" = "amd64" ]; then /ctx/initramfs.sh; else echo "Skipping initramfs for $TARGETARCH"; fi
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/var \
--mount=type=tmpfs,dst=/tmp \
/ctx/finalize.sh
# Inject kargs
COPY kargs/console.toml /usr/lib/bootc/kargs.d/console.toml
### LINTING
## Verify final image and contents are correct.
RUN if [ "$TARGETARCH" = "amd64" ]; then bootc container lint; else echo "Skipping bootc lint on $TARGETARCH due to QEMU emulation limits"; fi