Issue #3118
This commit is contained in:
Родитель
333cd1d8b7
Коммит
ed8fa92a04
|
@ -691,21 +691,8 @@ LABEL legal="http://go.microsoft.com/fwlink/?LinkId=837447" \
|
|||
Write-Host "$populateBuildFolder populated, skipping build of image"
|
||||
}
|
||||
else {
|
||||
$success = $false
|
||||
try {
|
||||
docker build --isolation=$isolation --memory $memory --no-cache --tag $imageName $buildFolder | ForEach-Object {
|
||||
$_ | Out-Host
|
||||
if ($_ -like "Successfully built*") {
|
||||
$success = $true
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
if (!$success) {
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Docker Build failed with exit code $LastExitCode"
|
||||
} else {
|
||||
throw "Docker Build didn't indicate successfully built"
|
||||
}
|
||||
if (!(DockerDo -command build -parameters @("--isolation=$isolation", "--memory $memory", "--no-cache", "--tag $imageName") -imageName $buildFolder)) {
|
||||
throw "Docker Build didn't indicate success"
|
||||
}
|
||||
|
||||
$timespend = [Math]::Round([DateTime]::Now.Subtract($startTime).Totalseconds)
|
||||
|
|
|
@ -67,7 +67,9 @@ LABEL org.opencontainers.image.vendor="Traefik Labs" \
|
|||
org.opencontainers.image.documentation="https://docs.traefik.io"
|
||||
"@ | Set-Content 'DOCKERFILE'
|
||||
|
||||
docker build --tag $imageName . | Out-Host
|
||||
if (!(DockerDo -command build -parameters @("--tag $imageName") -imageName (Get-Location).Path)) {
|
||||
throw "Docker Build didn't indicate success"
|
||||
}
|
||||
|
||||
if (!$doNotUpdateConfig) {
|
||||
$bcContainerHelperConfig.TraefikImage = $imageName
|
||||
|
|
|
@ -161,7 +161,7 @@ function DockerDo {
|
|||
Param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$imageName,
|
||||
[ValidateSet('run', 'start', 'pull', 'restart', 'stop', 'rmi')]
|
||||
[ValidateSet('run', 'start', 'pull', 'restart', 'stop', 'rmi','build')]
|
||||
[string]$command = "run",
|
||||
[switch]$accept_eula,
|
||||
[switch]$accept_outdated,
|
||||
|
|
Загрузка…
Ссылка в новой задаче