|
| 1 | +#------------------------------------------------------------------------------------------------------------- |
| 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. |
| 4 | +#------------------------------------------------------------------------------------------------------------- |
| 5 | + |
| 6 | +FROM mcr.microsoft.com/dotnet/core/sdk:2.1.802 |
| 7 | + |
| 8 | +# Avoid warnings by switching to noninteractive |
| 9 | +ENV DEBIAN_FRONTEND=noninteractive |
| 10 | + |
| 11 | +# Configure apt and install packages |
| 12 | +RUN apt-get update && apt-get -y install --no-install-recommends apt-utils 2>&1 \ |
| 13 | + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed |
| 14 | + && apt-get -y install git procps lsb-release \ |
| 15 | + # Install PowerShell |
| 16 | + && apt-get install curl gnupg apt-transport-https -y \ |
| 17 | + && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ |
| 18 | + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list \ |
| 19 | + && apt-get update \ |
| 20 | + && apt-get install -y powershell \ |
| 21 | + # Clean up |
| 22 | + && apt-get autoremove -y \ |
| 23 | + && apt-get clean -y \ |
| 24 | + && rm -rf /var/lib/apt/lists/* |
| 25 | + |
| 26 | +# Switch back to dialog for any ad-hoc use of apt-get |
| 27 | +ENV DEBIAN_FRONTEND=dialog |
| 28 | + |
| 29 | +SHELL ["/usr/bin/pwsh", "-Command"] |
| 30 | + |
| 31 | +# Install PowerShell modules required for building and testing |
| 32 | +RUN Install-Module InvokeBuild -Force |
| 33 | +RUN Install-Module platyPS -Force |
| 34 | +RUN Install-Module Pester -Force |
0 commit comments