Add dockerrun.ps1 script for Windows
This should enable using Docker to build / test Linux builds on a Windows host machine
This commit is contained in:
parent
bc6f7937ee
commit
5bfb634156
1 changed files with 55 additions and 0 deletions
55
eng/dockerrun.ps1
Normal file
55
eng/dockerrun.ps1
Normal file
|
@ -0,0 +1,55 @@
|
|||
[CmdletBinding(PositionalBinding=$false)]
|
||||
Param(
|
||||
[bool] $noninteractive = $false,
|
||||
[string] $dockerImageName,
|
||||
[string] $dockerContainerTag = "dotnetcli-build",
|
||||
[string] $dockerContainerName = "dotnetcli-build-container",
|
||||
[Parameter(ValueFromRemainingArguments=$true)][String[]]$additionalArgs
|
||||
)
|
||||
|
||||
Write-Host "Docker image name: $dockerImageName"
|
||||
|
||||
. $PSScriptRoot\common\tools.ps1
|
||||
|
||||
# docker build -f old\scripts\docker\rhel\Dockerfile --build-arg USER_ID=1000 -t redhat .
|
||||
# docker run -it -v c:\git\core-sdk-arcade:/opt/code redhat bash
|
||||
|
||||
$dockerFile = Resolve-Path (Join-Path $RepoRoot "eng\docker\$dockerImageName")
|
||||
|
||||
docker build --build-arg USER_ID=1000 -t "$dockerContainerTag" $dockerFile
|
||||
|
||||
$interactiveFlag = "-i"
|
||||
if ($noninteractive)
|
||||
{
|
||||
$interactiveFlag = ""
|
||||
}
|
||||
|
||||
` # -e DOTNET_INSTALL_DIR=/opt/code/artifacts/docker/$dockerImageName/.dotnet `
|
||||
|
||||
docker run $interactiveFlag -t --rm --sig-proxy=true `
|
||||
--name "$dockerContainerName" `
|
||||
-v "${RepoRoot}:/opt/code" `
|
||||
-e CHANNEL `
|
||||
-e DOTNET_BUILD_SKIP_CROSSGEN `
|
||||
-e PUBLISH_TO_AZURE_BLOB `
|
||||
-e NUGET_FEED_URL `
|
||||
-e NUGET_API_KEY `
|
||||
-e ARTIFACT_STORAGE_ACCOUNT `
|
||||
-e ARTIFACT_STORAGE_CONTAINER `
|
||||
-e CHECKSUM_STORAGE_ACCOUNT `
|
||||
-e CHECKSUM_STORAGE_CONTAINER `
|
||||
-e BLOBFEED_STORAGE_CONTAINER `
|
||||
-e CLIBUILD_SKIP_TESTS `
|
||||
-e COMMITCOUNT `
|
||||
-e DROPSUFFIX `
|
||||
-e RELEASESUFFIX `
|
||||
-e COREFXAZURECONTAINER `
|
||||
-e AZUREACCOUNTNAME `
|
||||
-e RELEASETOOLSGITURL `
|
||||
-e CORESETUPBLOBROOTURL `
|
||||
-e PB_ASSETROOTURL `
|
||||
-e PB_PACKAGEVERSIONPROPSURL `
|
||||
-e PB_PUBLISHBLOBFEEDURL `
|
||||
-e EXTERNALRESTORESOURCES `
|
||||
$dockerContainerTag `
|
||||
/opt/code/run-build.sh @additionalArgs
|
Loading…
Add table
Reference in a new issue