This Docker image Tested end-to-end of a Complete CI-CD DotNet AzureWebapp.
282
FROM premsai26/windows_salve:03
SHELL ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command"]
ENV TEST_CONTAINER=1 \
VS_CHANNEL_URI=https://aka.ms/vs/15/release/799c44140/channel \
VS_BUILDTOOLS_URI=https://aka.ms/vs/15/release/799c44140/vs_buildtools.exe \
VS_BUILDTOOLS_SHA256=FA29EB83297AECADB0C4CD41E54512C953164E64EEDD9FB9D3BF9BD70C9A2D29
# Download log collection utility
RUN $ErrorActionPreference = 'Stop'; \
$ProgressPreference = 'SilentlyContinue'; \
$VerbosePreference = 'Continue'; \
Invoke-WebRequest -Uri https://aka.ms/vscollect.exe -OutFile C:\collect.exe
# Download vs_buildtools.exe
RUN $ErrorActionPreference = 'Stop'; \
$ProgressPreference = 'SilentlyContinue'; \
$VerbosePreference = 'Continue'; \
Invoke-WebRequest -Uri $env:VS_BUILDTOOLS_URI -OutFile C:\vs_buildtools.exe; \
if ((Get-FileHash -Path C:\vs_buildtools.exe -Algorithm SHA256).Hash -ne $env:VS_BUILDTOOLS_SHA256) { throw 'Download hash does not match' }
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools
# Install Visual Studio Build Tools
RUN $ErrorActionPreference = 'Stop'; \
$VerbosePreference = 'Continue'; \
$p = Start-Process -Wait -PassThru -FilePath C:\vs_buildtools.exe -ArgumentList '--quiet --nocache --wait --installPath C:\BuildTools'; \
if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }
RUN $ErrorActionPreference = 'Stop'; \
$VerbosePreference = 'Continue'; \
$p = Start-Process -Wait -PassThru -FilePath C:\vs_buildtools.exe -ArgumentList 'modify --quiet --nocache --wait --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.MSBuildTools'; \
if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }
RUN $ErrorActionPreference = 'Stop'; \
$VerbosePreference = 'Continue'; \
$p = Start-Process -Wait -PassThru -FilePath C:\vs_buildtools.exe -ArgumentList 'modify --quiet --nocache --wait --installPath C:\BuildTools --add Microsoft.VisualStudio.Component.Static.Analysis.Tools'; \
if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }
RUN choco install -y netfx-4.5.2-devpack
RUN choco install -y netfx-4.6.1-devpack
RUN choco install -y azure-cli
RUN choco install -y nodejs
RUN npm install -g @angular/[email protected]
ENV ANT_HOME c:\\jenkins\\ant
ENV MVN_HOME c:\\jenkins\\maven
COPY "ant" "ant"
RUN $env:PATH = $env:ANT_HOME + '\\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);
COPY "apache-maven-3.5.4" "maven"
RUN $env:PATH = $env:MVN_HOME + '\\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);
ENV NUGET_HOME c:\\jenkins\\nuget
COPY "nuget" "nuget"
RUN $env:PATH = $env:NUGET_HOME + '\\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);
ENV SONAR_HOME c:\\jenkins\\sonar
COPY "sonar-scanner" "sonar"
RUN $env:PATH = $env:SONAR_HOME + '\\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);
COPY "sonarscanner-msbuild" "sonarscanner-msbuild"
COPY "terraform" "terraform"
ENV TERRAFORM c:\\jenkins\\terraform
RUN $env:PATH = $env:TERRAFORM + '\\;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);
COPY "PublishProfiles" "PublishProfiles"
#RUN choco install -y dotnetcore-sdk
ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.1.5xx/dotnet-sdk-latest-win-x64.zip
RUN powershell -Command Invoke-WebRequest $Env:DOTNET_SDK_DOWNLOAD_URL -OutFile dotnet.zip;Expand-Archive dotnet.zip -DestinationPath dotnet -Force; Remove-Item -Force dotnet.zip
ENV DOTNET c:\\jenkins\\dotnet
RUN $env:PATH = $env:DOTNET + '\\;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);
ENTRYPOINT ["cmd.exe"]
# Use shell form to start developer command prompt and any other commands specified
#SHELL ["cmd.exe", "/s", "/c"]
#ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat &&
# Default to PowerShell console running within developer command prompt environment
#CMD ["powershell.exe", "-nologo"]
Content type
Image
Digest
Size
7.4 GB
Last updated
almost 7 years ago
docker pull premsai26/windows_salve:vs2017