Files
PSProxmoxVE/tests/Dockerfile.test
T
goodolclint-claude[bot] b90791e2bf docs: migrate DECISIONS.md to house-format ADRs, and retire the review folder (#131)
D001-D021 become ADR 0001-0021 in docs/decisions/, one decision per file.
D017's PESTER_VERSION amendment was a second decision in one entry and becomes
ADR 0022. ADR 0023 records the migration and reverses the lane2-change-plan
ruling that deliberately kept DECISIONS.md until the CI lane work landed.

DECISIONS.md is reduced to a stub with a D-to-ADR redirect table, so the four
released CHANGELOG entries and older issue bodies that cite it degrade to a
redirect rather than a dead reference.

docs/review/ and docs/lane2-change-plan.md are deleted (ADR 0024). Of 91
findings, 83 were resolved and six of the seven still open were already GitHub
issues; F021 was the exception and is now #130.

CLAUDE.md's Key Conventions list gains the two rules it was missing and becomes
the checklist, with the ADRs carrying rationale.
2026-09-02 14:49:07 +00:00

76 lines
3.7 KiB
Docker

# PSProxmoxVE development and integration testing container
#
# Two targets:
# dev - .NET SDK + PowerShell + Pester (build & test, works on ARM/x86)
# dev-infra - Adds Terraform + PVE provisioning tools (x86 only)
#
# Usage:
# # For build + test (works on Mac M-series):
# docker compose -f tests/docker-compose.test.yml up -d
#
# # For full CI flow including provisioning (x86 only):
# docker compose -f tests/docker-compose.test.yml --profile infra up -d
# ── Base: .NET SDK + PowerShell + Pester ────────────────────────────
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS dev
ENV DEBIAN_FRONTEND=noninteractive
# Install base packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl jq openssh-client ca-certificates apt-transport-https gnupg \
&& rm -rf /var/lib/apt/lists/*
# Install PowerShell: APT package on amd64, dotnet global tool on arm64.
# The Microsoft APT repo does not publish arm64 packages for PowerShell.
RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc \
| gpg --dearmor -o /usr/share/keyrings/microsoft-archive-keyring.gpg \
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] \
https://packages.microsoft.com/ubuntu/24.04/prod noble main" \
> /etc/apt/sources.list.d/microsoft-prod.list \
&& apt-get update && apt-get install -y --no-install-recommends powershell \
&& rm -rf /var/lib/apt/lists/*; \
else \
dotnet tool install --global PowerShell \
&& ln -s /root/.dotnet/tools/pwsh /usr/local/bin/pwsh; \
fi
# Install Pester and prepare module directory.
# Pinned, not floored: this image is rebuilt on every CI run, so a version range
# lets a new Pester major reach the gating lane with no commit to this repo.
# Bump deliberately, the way ADR 0017 treats the nested PVE package set.
ARG PESTER_VERSION=6.1.0
RUN pwsh -NoProfile -Command \
"Set-PSRepository -Name PSGallery -InstallationPolicy Trusted; \
Install-Module -Name Pester -RequiredVersion $PESTER_VERSION -Scope AllUsers -Force" \
&& pwsh -NoProfile -Command \
"if (-not (Get-Module -ListAvailable Pester | Where-Object Version -eq '$PESTER_VERSION')) { throw 'Pester $PESTER_VERSION not installed' }" \
&& mkdir -p /usr/local/share/powershell/Modules/PSProxmoxVE
# Promoted to ENV so the suite can pin its import too — the install pin alone
# does not bind the point of use if a second Pester ever reaches PSModulePath.
ENV PESTER_VERSION=$PESTER_VERSION
WORKDIR /repo
CMD ["pwsh", "-NoProfile"]
# ── Full: adds Terraform + PVE provisioning tools (x86 only) ───────
FROM dev AS dev-infra
RUN apt-get update && apt-get install -y --no-install-recommends \
dosfstools mtools sshpass python3 xorriso gnupg \
&& curl -fsSL https://apt.releases.hashicorp.com/gpg \
| gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg \
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com noble main" \
> /etc/apt/sources.list.d/hashicorp.list \
&& curl -fsSL https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg \
-o /usr/share/keyrings/proxmox-release-bookworm.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/proxmox-release-bookworm.gpg] \
http://download.proxmox.com/debian/pve bookworm pve-no-subscription" \
> /etc/apt/sources.list.d/proxmox-pve.list \
&& apt-get update && apt-get install -y --no-install-recommends \
terraform proxmox-auto-install-assistant qemu-utils \
&& rm -rf /var/lib/apt/lists/*