This commit is contained in:
Freddy Kristiansen 2023-07-18 17:21:11 +02:00
Родитель 333cd1d8b7
Коммит ed8fa92a04
3 изменённых файлов: 6 добавлений и 17 удалений

Просмотреть файл

@ -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,