Skip to content

Commit

Permalink
Update .devcontainer to use nightly docker SDK images (#13128)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan committed Jul 7, 2020
1 parent 6d7e30d commit 90c7ed6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions DotnetRuntimeMetadata.json
Expand Up @@ -2,6 +2,7 @@
"sdk": {
"channel": "release/5.0.1xx-preview7",
"packageVersionPattern": "5.0.0-preview.7",
"sdkImageVersion": "5.0.100-preview.7",
"nextChannel": "net5/preview7"
}
}
11 changes: 11 additions & 0 deletions tools/UpdateDotnetRuntime.ps1
Expand Up @@ -157,6 +157,15 @@ function Get-DotnetUpdate {
}
}

function Update-DevContainer {
$dockerFilePath = "$PSScriptRoot/../.devcontainer/Dockerfile"
$sdkImageVersion = (Get-Content -Raw "$PSScriptRoot/../DotnetRuntimeMetadata.json" | ConvertFrom-Json).sdk.sdkImageVersion

$devContainerDocker = (Get-Content $dockerFilePath) -replace 'FROM mcr\.microsoft\.com/dotnet.*', "FROM mcr.microsoft.com/dotnet/nightly/sdk:$sdkImageVersion"

$devContainerDocker | Out-File -FilePath $dockerFilePath -Force
}

$dotnetUpdate = Get-DotnetUpdate

if ($dotnetUpdate.ShouldUpdate) {
Expand Down Expand Up @@ -228,4 +237,6 @@ if ($dotnetUpdate.ShouldUpdate) {
}
}
}

Update-DevContainer
}

0 comments on commit 90c7ed6

Please sign in to comment.