PSRule
PSRule copied to clipboard
Add walkthrough for running PSRule within a Docker container
Currently PSRule supports Windows using PowerShell 5.1 and above.
This is great for Windows administrators however not great for everyone else. When enabling validation within a CI/CD pipeline, the agent platform might not be Windows.
Containers provide portability and consistency which is very applicable for PSRule.
PowerShell is already available in a published Docker container.
docker pull mcr.microsoft.com/powershell
i.e.
docker run -it --rm mcr.microsoft.com/powershell
Requires #49
An example Dockerfile.
FROM mcr.microsoft.com/powershell:ubuntu-16.04
SHELL ["pwsh", "-command"]
RUN Install-Module -Name PSRule -AllowPrerelease -Force;
RUN Import-Module -Name PSRule;
ARG IMAGE_NAME=PSRule:0.2.0-ubuntu-16.04
LABEL maintainer="Bernie White" \
readme.md="https://github.com/BernieWhite/PSRule/blob/master/README.md" \
description="This Dockerfile will install the PSRule PowerShell module."
CMD [ "pwsh" ]
At this stage providing tooling is not required. This issue should focus on documention.