├── .devcontainer └── devcontainer.json ├── .vscode └── settings.json ├── Containers └── Distroless │ ├── Containerfile │ └── README.MD ├── Examples ├── Script │ ├── Dockerfile │ ├── README.MD │ └── main.ps1 └── ScriptWithModules │ ├── Dockerfile │ ├── README.MD │ └── main.ps1 ├── LICENSE.MD ├── README.MD ├── build.ps1 └── images └── README └── image.png /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PowerShell Runtime Containers", 3 | "image": "mcr.microsoft.com/devcontainers/dotnet:1-10.0-preview-trixie-slim", //Trixie needed for podman/buildah updates 4 | "privileged": true, 5 | "hostRequirements": { 6 | "cpus": 4 // To build containers in parallel and match the GitHub Actions environment 7 | }, 8 | "initializeCommand": "docker images -a", //To see what images are cached on the devcontainer or host 9 | "postCreateCommand": "sudo apt-get update && sudo apt-get install -y podman skopeo && sudo mount --make-rshared / && sudo ln -s /usr/bin/podman /usr/bin/docker", 10 | "containerEnv": { 11 | "PODMAN_IGNORE_CGROUPSV1_WARNING": "true" 12 | }, 13 | "customizations": { 14 | "vscode": { 15 | "extensions": [ 16 | "ms-vscode.powershell", 17 | "ms-azuretools.vscode-containers", 18 | "GitHub.vscode-pull-request-github" 19 | ] 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Containers/Distroless/Containerfile: -------------------------------------------------------------------------------- 1 | #These args will vary based on the build. This is a multi-arch build 2 | ARG DIST=noble-chiseled 3 | ARG PS_VERSION=7.5.1 4 | 5 | #This needs to match the pwsh build version. The build script does this detectin work via global.json of the commit of the release 6 | ARG DOTNET_VERSION=9.0 7 | 8 | 9 | #Autogenerated args based on the build 10 | ARG BUILDPLATFORM TARGETOS TARGETARCH 11 | 12 | #You wont typically need to vary these args 13 | ARG PS_PACKAGE_BASE=powershell-${PS_VERSION}-${TARGETOS} 14 | ARG PS_PACKAGE_BASE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE_BASE} 15 | ARG PS_INSTALL_FOLDER=/opt/microsoft/powershell/7 16 | ARG LANG=en_US.UTF-8 17 | ARG IMAGE=mcr.microsoft.com/dotnet/runtime-deps:$DOTNET_VERSION-$DIST 18 | ARG TAG=$PS_VERSION-$DIST-$TARGETARCH 19 | 20 | #STAGE: Install PowerShell 21 | FROM --platform=$BUILDPLATFORM alpine AS install-powershell 22 | ARG PS_INSTALL_FOLDER PS_VERSION PS_PACKAGE_BASE_URL TARGETARCH TARGETPLATFORM 23 | #Passed thru so it can reach the configure stage 24 | RUN <