22# ============================================================================
33# MiOS - Unified Image (v0.2.0)
44# ============================================================================
5- # One image. Every role. Every surface. Every GPU vendor.
6- #
7- # Base: Controlled by MIOS_BASE_IMAGE in .env.mios
8- # Default: ghcr.io/ublue-os/ucore-hci:stable-nvidia
9- # ============================================================================
105
11- ARG BASE_IMAGE=ghcr.io/ublue-os/ucore-hci:stable-nvidia # @track:IMG_BASE
6+ ARG BASE_IMAGE=ghcr.io/ublue-os/ucore-hci:stable-nvidia
127
13- # ----------------------------------------------------------------------------
14- # ctx stage: build context
15- # ----------------------------------------------------------------------------
8+ # --- ctx stage: build context ---
169FROM scratch AS ctx
1710COPY automation/ /ctx/automation/
1811COPY usr/ /ctx/usr/
1912COPY etc/ /ctx/etc/
2013COPY home/ /ctx/home/
2114COPY usr/share/mios/PACKAGES.md /ctx/PACKAGES.md
22- COPY VERSION /ctx/VERSION
23- COPY config/artifacts/ /ctx/bib-configs/
24- COPY tools/ /ctx/tools/
15+ COPY VERSION /ctx/VERSION
16+ COPY config/artifacts/ /ctx/bib-configs/
17+ COPY tools/ /ctx/tools/
2518
26- # ----------------------------------------------------------------------------
27- # main stage
28- # ----------------------------------------------------------------------------
29- FROM ${BASE_IMAGE}
19+ # --- main stage ---
20+ FROM
3021
3122LABEL org.opencontainers.image.title="MiOS"
32- LABEL org.opencontainers.image.description="Unified immutable cloud-native workstation OS"
33- LABEL org.opencontainers.image.source="https://github.com/MiOS-DEV/MiOS-bootstrap"
34- LABEL org.opencontainers.image.licenses="Apache-2.0"
3523LABEL org.opencontainers.image.version="v0.2.0"
3624LABEL containers.bootc="1"
3725LABEL ostree.bootable="1"
@@ -42,17 +30,13 @@ ARG MIOS_USER=mios
4230ARG MIOS_HOSTNAME=mios
4331ARG MIOS_FLATPAKS=
4432
45- # Build context mounted read-only
33+ # Copy context
4634COPY --from=ctx /ctx /ctx
4735
48- # Unified Build Pipeline: Install -> Overlay -> Automation -> Cleanup
49- RUN --mount=type=cache,dst=/var/cache/libdnf5,sharing=locked --mount=type=cache,dst=/var/cache/dnf,sharing=locked set -e; # 1. Install essential security packages dnf install -y --skip-unavailable --setopt=install_weak_deps=False policycoreutils-python-utils selinux-policy-targeted firewalld audit fapolicyd crowdsec usbguard kernel-devel; # 2. Inject flatpaks if provided if [[ -n "${MIOS_FLATPAKS}" ]]; then echo "${MIOS_FLATPAKS}" | tr "," "\n" > /ctx/usr/share/mios/flatpak-list; fi; # 3. Rootfs Overlay bash /ctx/automation/08-system-files-overlay.sh; # 4. Numbered Pipeline chmod +x /ctx/automation/build.sh /ctx/automation/*.sh 2>/dev/null || true; chmod +x /usr/libexec/mios/copy-build-log.sh; /ctx/automation/build.sh; # 5. Mandatory Cleanup for bootc lint dnf clean all; find /var -mindepth 1 -maxdepth 1 ! -name tmp -exec rm -rf {} +; find /run -mindepth 1 -maxdepth 1 ! -name "secrets" -exec rm -rf {} + 2>/dev/null || true
36+ # Unified Build Pipeline
37+ RUN --mount=type=cache,dst=/var/cache/libdnf5,sharing=locked --mount=type=cache,dst=/var/cache/dnf,sharing=locked set -ex; dnf install -y --skip-unavailable --setopt=install_weak_deps=False policycoreutils-python-utils selinux-policy-targeted firewalld audit fapolicyd crowdsec usbguard kernel-devel; if [[ -n "" ]]; then echo "" | tr "," "\n " > /ctx/usr/share/mios/flatpak-list; fi; bash /ctx/automation/08-system-files-overlay.sh; chmod +x /ctx/automation/build.sh /ctx/automation/*.sh; /ctx/automation/build.sh; dnf clean all; find /var -mindepth 1 -maxdepth 1 ! -name tmp -exec rm -rf {} +; find /run -mindepth 1 -maxdepth 1 ! -name "secrets" -exec rm -rf {} + 2>/dev/null || true
5038
51- # Install bootc bash completions
5239RUN bootc completion bash > /etc/bash_completion.d/bootc
53-
54- # -- systemd-sysext consolidation ----------
55- RUN mkdir -p /usr/lib/extensions/source && chmod +x /ctx/tools/mios-sysext-pack.sh && /ctx/tools/mios-sysext-pack.sh /usr/lib/extensions/source || true
56-
57- RUN rm -rf /ctx && ostree container commit
40+ RUN mkdir -p /usr/lib/extensions/source && chmod +x /ctx/tools/mios-sysext-pack.sh && /ctx/tools/mios-sysext-pack.sh /usr/lib/extensions/source || true
41+ RUN rm -rf /ctx && ostree container commit
5842RUN bootc container lint
0 commit comments