An open API service indexing awesome lists of open source software.

https://github.com/cezarypiatek/powershellcontainers

How to build docker containers that use PowerShell
https://github.com/cezarypiatek/powershellcontainers

Last synced: 4 months ago
JSON representation

How to build docker containers that use PowerShell

Awesome Lists containing this project

README

          

# PowerShellContainers
All available tags for base images released by Microsoft can be found here https://hub.docker.com/_/microsoft-powershell

## Building docker containers that use PowerShelll

```dockerfile
FROM mcr.microsoft.com/powershel
SHELL ["pwsh", "-Command"]
RUN Set-PSRepository -Name "PSGallery" -InstalationPolicy Trusted
RUN Install-Module SampleModule
ADD SampleScript.ps1 /scripts/SampleScript.ps1
ENTRYPOINT ["pwsh", "-Command", "/scripts/SampleScript.ps1"]
```

## Running PowersShell interactive console inside container

```shell
docker run -it --rm mcr.microsoft.com/powershell
```