This directory contains custom container image definitions for the homelab infrastructure.
Each sub-directory represents a separate container image:
containers/
├── <container-name>/
│ ├── Containerfile # OCI-compliant container definition
│ ├── README.md # Container description and usage
│ └── .containerignore # Files to exclude from build context
Build a container locally using Podman:
cd containers/<container-name>
podman build -t <container-name>:latest .Or with Docker:
cd containers/<container-name>
docker build -f Containerfile -t <container-name>:latest .The CI build system automatically handles container dependencies using a naming convention and explicit configuration:
-
Base Containers (Auto-detected)
- Containers with names ending in
-base - Built first in the pipeline
- Example:
devspace-base
- Containers with names ending in
-
Dependent Containers (Explicitly Listed)
- Containers that depend on base containers
- Listed in
.github/workflows/container-build.ymlunderDEPENDENT_CONTAINERS - Built after base containers complete
- Example:
devspace-homelab(depends ondevspace-base)
-
Independent Containers (All Others)
- Containers that don't depend on other project containers
- Build in parallel with base containers
- Example:
hf-cli
graph LR
A[detect-changes] --> B[build-base-containers]
A --> C[build-independent-containers]
B --> D[build-dependent-containers]
style B fill:#e1f5ff
style D fill:#e1f5ff
style C fill:#ccffcc
Pipeline Stages:
- Base containers build first (e.g.,
devspace-base) - Independent containers build in parallel with base (e.g.,
hf-cli) - Dependent containers build after base completes (e.g.,
devspace-homelab)
For a new base container:
- Name it with the
-basesuffix (e.g.,myapp-base) - No workflow configuration needed (auto-detected)
For a container depending on a base:
- Add container name to
DEPENDENT_CONTAINERSin.github/workflows/container-build.yml - Reference the base image in your
FROMstatement
For an independent container:
- No special configuration needed
- Will build in parallel with base containers
Current containers:
devspace-base→ Base container (auto-detected by-basesuffix)devspace-homelab→ Depends ondevspace-base(explicitly listed)hf-cli→ Independent container
- Use
Containerfile(OCI standard) rather thanDockerfile - Include a
README.mddescribing the container's purpose - Include a
.containerignoreto minimize build context - Use meaningful labels in the Containerfile
- All containers must support both arm64 and x86_64 (amd64) architectures
- Use
ARG TARGETARCHfor architecture detection during multi-platform builds - Download architecture-specific binaries using conditional logic based on
$TARGETARCH
- Use
- Use
-basesuffix for base containers that other containers will depend on