Skip to content

Repository files navigation

PowerShell Runtime Containers

This repository provides modern container builds for running PowerShell Scripts.

Found at: ghcr.io/justingrote/powershell

Optimized for:

🤏 Small Footprint (~140Mb)

⏱️ High Performance

👮 Minimal Security Surface Area


20250329-2208-21.7151526.mp4

⚡ Quick Start

Note

By default the container will run any powershell script passed to it as an argument, either directly or via stdin.

docker run ghcr.io/justingrote/powershell '"Welcome to PowerShell $($PSVersionTable.PSVersion)"'

Welcome to PowerShell 7.5.0

🏷️ Tags

Note

The default distro is .NET Chiseled. Azure Linux 3.0 distroless is also available.

  • latest - latest stable version
  • lts - latest lts version
  • X - latest specified major version. For example: 7 is the latest 7.x.x version
  • X-lts - latest specified major lts version (e.g. 7-lts is 7.4.Z but not 7.5.Z)
  • X.Y - latest feature version. For example: 7.4 is latest 7.4.Z version.
  • 7.X.Y - "pinned" version to the version you specify. For example: 7.4.2 will always be 7.4.2
  • azurelinux3.0-distroless - latest stable version using .NET Azure Linux 3.0 distroless
  • dotnet-chiseled - latest stable version using latest .NET Chiseled
  • noble-chiseled - latest stable version using .NET Chiseled for Ubuntu 24.04 (Noble)
  • resolute-chiseled - latest stable using .NET Chiseled for Ubuntu 26.04 (Resolute)

Tip

Tags should not be considered immutable and are provided for convenience. I reserve the right to make breaking changes to any tag at any time. You should pin specific SHA versions if stability and predictability is a need in your environment, and to avoid unlikely but possible supply chain attacks to this repository. That said, most tags should remain relatively stable, e.g. 7.4 will always be the latest version of 7.4, but the underlying container architecture might undergo minor changes.

📦 Bundling

To create new container applications, define a new Dockerfile or Containerfile that bundles your script and any modules or components your script requires.

About These Containers

These images run the self-contained version of PowerShell on top of distroless container bases to minimize size and security surface.

Removed Features for size/security:

  1. PowerShellGet/PSResourceGet/PackageManagement removed (you should bundle modules into your container directly)
  2. Help Removed
  3. PSReadline Removed (this is not meant for interactive use)
  4. Some unnecessary assemblies for most workloads removed (SQLClient, ODBC, etc.). You should bundle in modern equivalents with your docker image if you need these.
  5. Localization Support removed. If there is sufficient demand for a localization-enabled container, I will build a version based on AzureLinux-extra which includes the required localization parts.

The images are multi-arch, supporting x64 and arm64-v8.

The image also runs under a local non-root user by default.

By default, there is no writable filesystem access besides /tmp and /home/app for security. You can layer in writable filesystems if needed, but it is recommended to mount volumes instead.

Alpine builds have been deprecated for now in favor of distroless builds. Interactive users should use the official .NET SDK or Devcontainer images.

While fxdependent is smaller, the self-contained images contain precompliation that result in a huge (50%+) startup CPU and time cost, so the minor extra 30MB or so is considered worth the size increase, especially since the size is a one-time hit.

Updates

There are plans to auto-generate new images upon new PowerShell release within 24 hours, potentially as soon as a release is posted. For now releases are generated to powershell-test, smoke tested manually, and then graduated to powershell

About

PowerShell Runtime Containers: Optimized for Size, Security, and Speed

Resources

Stars

42 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages