Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions eng/docker/build-docker-sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Param(
[switch][Alias('w')]$buildWindowsContainers
)

Set-PSDebug -Trace 1

$ErrorActionPreference = "Stop"

$REPO_ROOT_DIR=$(git -C "$PSScriptRoot" rev-parse --show-toplevel)
[xml]$xml = Get-Content (Join-Path $REPO_ROOT_DIR "eng\Versions.props")
$VERSION="$($xml.Project.PropertyGroup.MajorVersion[0]).$($xml.Project.PropertyGroup.MinorVersion[0])"

$dockerFilePrefix="$PSScriptRoot/libraries-sdk"

if ($buildWindowsContainers)
{
# Due to size concerns, we don't currently do docker builds on windows.
Expand All @@ -29,8 +29,6 @@ if ($buildWindowsContainers)
exit $LASTEXITCODE
}

$dockerFile="$dockerFilePrefix.windows.Dockerfile"

# Collect the following artifacts to folder, that will be used as build context for the container,
# so projects can build and test against the live-built runtime:
# 1. Reference assembly pack (microsoft.netcore.app.ref)
Expand All @@ -55,6 +53,8 @@ if ($buildWindowsContainers)
-Destination $dockerContext\targetingpacks.targets
Copy-Item -Recurse -Path $REPO_ROOT_DIR\src\libraries\System.Net.Quic\src\System\Net\Quic\Interop `
-Destination $dockerContext\msquic-interop
Copy-Item -Path $PSScriptRoot\libraries-sdk.windows.Dockerfile `
-Destination $dockerContext

# In case of non-CI builds, testhost may already contain Microsoft.AspNetCore.App (see build-local.ps1 in HttpStress):
$testHostAspNetCorePath="$dockerContext\testhost\net$VERSION-windows-$configuration-x64/shared/Microsoft.AspNetCore.App"
Expand All @@ -65,18 +65,17 @@ if ($buildWindowsContainers)
docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--build-arg VERSION=$VERSION `
--file $dockerFile `
--file $dockerContext\libraries-sdk.windows.Dockerfile `
$dockerContext
}
else
{
# Docker build libraries and copy to dotnet sdk image
$dockerFile="$dockerFilePrefix.linux.Dockerfile"

docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--build-arg "VERSION=$VERSION" `
--file $dockerFile `
--file $PSScriptRoot/libraries-sdk.linux.Dockerfile `
$REPO_ROOT_DIR
}

Expand Down
Loading