Merge pull request #39582 from thaJeztah/its_a_stretch_but_it_was_busted
Pin Dockerfile to -stretch variant because it's bust'd
This commit is contained in:
commit
2101bfa7e7
4 changed files with 6 additions and 17 deletions
|
@ -27,7 +27,7 @@
|
|||
ARG CROSS="false"
|
||||
ARG GO_VERSION=1.12.7
|
||||
|
||||
FROM golang:${GO_VERSION} AS base
|
||||
FROM golang:${GO_VERSION}-stretch AS base
|
||||
ARG APT_MIRROR
|
||||
RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
|
||||
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
ARG GO_VERSION=1.12.7
|
||||
|
||||
FROM golang:${GO_VERSION}
|
||||
FROM golang:${GO_VERSION}-stretch
|
||||
|
||||
# allow replacing httpredir or deb mirror
|
||||
ARG APT_MIRROR=deb.debian.org
|
||||
|
|
|
@ -426,20 +426,9 @@ Try {
|
|||
Write-Host -ForegroundColor Green "INFO: Location for testing is $env:TEMP"
|
||||
|
||||
# CI Integrity check - ensure Dockerfile.windows and Dockerfile go versions match
|
||||
$goVersionDockerfileWindows=$(Get-Content ".\Dockerfile.windows" | Select-String "^ENV GO_VERSION" | Select-object -First 1).ToString().Replace("ENV GO_VERSION=","").Replace("\","").Replace("``","").Trim()
|
||||
$goVersionDockerfile=$(Get-Content ".\Dockerfile" | Select-String "^ENV GO_VERSION" | Select-object -First 1)
|
||||
|
||||
# As of go 1.11, Dockerfile changed to be in the format like "FROM golang:1.11.0 AS base".
|
||||
# If a version number ends with .0 (as in 1.11.0, a convention used in golang docker
|
||||
# image versions), it needs to be removed (i.e. "1.11.0" becomes "1.11").
|
||||
if ($null -eq $goVersionDockerfile) {
|
||||
$goVersionDockerfile=$(Get-Content ".\Dockerfile" | Select-String "^FROM golang:" | Select-object -First 1)
|
||||
if ($null -ne $goVersionDockerfile) {
|
||||
$goVersionDockerfile = $goVersionDockerfile.ToString().Split(" ")[1].Split(":")[1] -replace '\.0$',''
|
||||
}
|
||||
} else {
|
||||
$goVersionDockerfile = $goVersionDockerfile.ToString().Split(" ")[2]
|
||||
}
|
||||
$goVersionDockerfileWindows=(Select-String -Path ".\Dockerfile.windows" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value
|
||||
$goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value
|
||||
|
||||
if ($null -eq $goVersionDockerfile) {
|
||||
Throw "ERROR: Failed to extract golang version from Dockerfile"
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ Function Check-InContainer() {
|
|||
# outside of a container where it may be out of date with master.
|
||||
Function Verify-GoVersion() {
|
||||
Try {
|
||||
$goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^FROM golang:").ToString().Split(" ")[1].SubString(7) -replace '\.0$',''
|
||||
$goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value.TrimEnd(".0")
|
||||
$goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2)
|
||||
}
|
||||
Catch [Exception] {
|
||||
|
|
Loading…
Add table
Reference in a new issue