2025-12-12 16:40:21 +01:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-12 16:40:21 +01:00
|
|
|
# Base image selector — overridden by build args / Makefile
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-11 17:27:57 +01:00
|
|
|
ARG BASE_IMAGE
|
2025-07-11 07:19:44 +02:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
# ============================================================
|
|
|
|
|
# Target: virgin
|
|
|
|
|
# - installs distro deps (incl. make)
|
|
|
|
|
# - no pkgmgr build
|
|
|
|
|
# - no entrypoint
|
|
|
|
|
# ============================================================
|
|
|
|
|
FROM ${BASE_IMAGE} AS virgin
|
2025-12-12 16:50:32 +01:00
|
|
|
SHELL ["/bin/bash", "-lc"]
|
2025-12-11 17:27:57 +01:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
RUN echo "BASE_IMAGE=${BASE_IMAGE}" && cat /etc/os-release || true
|
2025-12-07 20:58:49 +01:00
|
|
|
|
2025-12-07 21:43:38 +01:00
|
|
|
WORKDIR /build
|
2025-12-09 05:31:55 +01:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
# Copy scripts first so dependency installation can be cached
|
|
|
|
|
COPY scripts/installation/ scripts/installation/
|
2025-12-09 05:31:55 +01:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
# Install distro-specific build dependencies (including make)
|
|
|
|
|
RUN bash scripts/installation/dependencies.sh
|
2025-12-09 05:31:55 +01:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
# Virgin default
|
|
|
|
|
CMD ["bash"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
# Target: full
|
|
|
|
|
# - inherits from virgin
|
|
|
|
|
# - builds + installs pkgmgr
|
|
|
|
|
# - sets entrypoint + default cmd
|
|
|
|
|
# ============================================================
|
|
|
|
|
FROM virgin AS full
|
|
|
|
|
|
|
|
|
|
# Nix environment defaults (only config; nix itself comes from deps/install flow)
|
|
|
|
|
ENV NIX_CONFIG="experimental-features = nix-command flakes"
|
|
|
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
|
|
# Copy full repository for build
|
2025-12-07 20:54:04 +01:00
|
|
|
COPY . .
|
2025-12-03 16:09:42 +01:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
# Build and install distro-native package-manager package
|
|
|
|
|
RUN set -euo pipefail; \
|
|
|
|
|
echo "Building and installing package-manager via make install..."; \
|
|
|
|
|
make install; \
|
|
|
|
|
cd /; rm -rf /build
|
2025-12-08 00:24:22 +01:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
# Entry point
|
|
|
|
|
COPY scripts/docker/entry.sh /usr/local/bin/docker-entry.sh
|
2025-07-11 07:19:44 +02:00
|
|
|
|
2025-12-12 16:40:21 +01:00
|
|
|
WORKDIR /src
|
2025-12-09 05:31:55 +01:00
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entry.sh"]
|
|
|
|
|
CMD ["pkgmgr", "--help"]
|