forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-docker-sdk.ps1
executable file
·38 lines (33 loc) · 1.32 KB
/
build-docker-sdk.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env pwsh
# Builds libraries and produces a dotnet sdk docker image
# that contains the current bits in its shared framework folder.
[CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('t')]$imageName = "dotnet-sdk-libs-current",
[string][Alias('c')]$configuration = "Release",
[switch][Alias('w')]$buildWindowsContainers
)
$ErrorActionPreference = "Stop"
$REPO_ROOT_DIR=$(git -C "$PSScriptRoot" rev-parse --show-toplevel)
if ($buildWindowsContainers)
{
# Due to size concerns, we don't currently do docker builds on windows.
# Build on the host machine, then simply copy artifacts to the target docker image.
# This should result in significantly lower build times, for now.
& "$REPO_ROOT_DIR/coreclr.cmd" -c Release
& "$REPO_ROOT_DIR/libraries.cmd" -ci -c $configuration -runtimeConfiguration release
# Dockerize the build artifacts
docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--build-arg TESTHOST_LOCATION=. `
--file "$PSScriptRoot/libraries-sdk.windows.Dockerfile" `
"$REPO_ROOT_DIR/artifacts/bin/testhost"
}
else
{
# Docker build libraries and copy to dotnet sdk image
docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--file "$PSScriptRoot/libraries-sdk.linux.Dockerfile" `
$REPO_ROOT_DIR
}