Sign inSign up

scrthq/powershell

By scrthq

•Updated over 3 years ago

Ubuntu 18.04 containers (pwsh & pwsh-preview) for PowerShell module building and testing.

Image
1

4.4K

scrthq/powershell repository overview

Containers for various PowerShell tasks.

Repository: https://github.com/SCRT-HQ/Dockerfiles⁠

⁠BuildTest

These containers are designed to come out-of-the-box with standard PowerShell module building and testing tools.

⁠Tags

  • latest-buildtest-ubu-1804: The latest stable release of pwsh (uses mcr.microsoft.com/powershell:ubuntu-18.04 as its base)
  • preview-buildtest-ubu-1804: The latest release of pwsh-preview (uses mcr.microsoft.com/powershell:preview-ubuntu-18.04 as its base)

⁠Included Tools

  • git
  • wget
  • mono-complete
  • libcurl3
  • unzip
  • zip
  • GitVersion 5.0.1 (accessible from pwsh using the gitversion function)

PowerShell modules installed w/ minimum versions:

Configuration     = '1.3.1'
PackageManagement = '1.3.1'
PowerShellGet     = '2.1.2'
InvokeBuild       = '5.5.2'
psake             = '4.8.0'
Pester            = '4.9.0'
PSScriptAnalyzer  = '1.18.2'

⁠Sample Usage

Dockerfile:

# Pull down the latest preview version of the image
FROM scrthq/powershell:preview-buildtest-ubu-1804
# Set the default shell for the container
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Copy current repo contents into the container's /source directory
COPY [".", "/source/"]
# Set the default working directory to the repo source folder
WORKDIR /source
# Add the entry script which will kick off the tests when the container is ran
ENTRYPOINT [ "pwsh", "-command", ". ./build.ps1 -Task Test" ]

azure-pipelines.yml:

resources:
- repo: self
  clean: true

stages:
- stage: Test
  jobs:
  - job: Test
    displayName: Test in container
    pool:
      name: Hosted Ubuntu 1604
    steps:
    - pwsh: docker build . -t test -f Dockerfile
      displayName: Build container image
    - pwsh: docker run --name test test
      displayName: Test Module in Container

Tag summary

Content type

Image

Digest

sha256:241862c21…

Size

300.3 MB

Last updated

over 3 years ago

docker pull scrthq/powershell:preview-noentrypoint-buildtest-ubu-2004