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
- Host: GitHub
- URL: https://github.com/cezarypiatek/powershellcontainers
- Owner: cezarypiatek
- Created: 2023-02-11T09:36:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T11:21:48.000Z (over 2 years ago)
- Last Synced: 2025-03-14T08:35:18.841Z (7 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```