完善本机构建镜像源配置
This commit is contained in:
parent
57fcd366f3
commit
2bb53abf80
2
deploy/buildkitd.toml
Normal file
2
deploy/buildkitd.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[registry."docker.io"]
|
||||||
|
mirrors = ["m.daocloud.io/docker.io"]
|
||||||
@ -10,6 +10,7 @@ param(
|
|||||||
[string]$RemotePath = '/opt/caiwuxitong',
|
[string]$RemotePath = '/opt/caiwuxitong',
|
||||||
[string]$AppUrl,
|
[string]$AppUrl,
|
||||||
[string]$BuilderName = 'caiwu-builder',
|
[string]$BuilderName = 'caiwu-builder',
|
||||||
|
[string]$BuildkitImage = 'm.daocloud.io/docker.io/moby/buildkit:buildx-stable-1',
|
||||||
[int]$KeepImages = 2,
|
[int]$KeepImages = 2,
|
||||||
[switch]$BootstrapServer,
|
[switch]$BootstrapServer,
|
||||||
[switch]$AllowNonMain,
|
[switch]$AllowNonMain,
|
||||||
@ -25,6 +26,7 @@ $tempRoot = Join-Path ([IO.Path]::GetTempPath()) ("caiwu-deploy-" + [Guid]::NewG
|
|||||||
$localArchive = Join-Path $tempRoot 'image.tar'
|
$localArchive = Join-Path $tempRoot 'image.tar'
|
||||||
$remoteArchive = $null
|
$remoteArchive = $null
|
||||||
$bootstrapRemote = $null
|
$bootstrapRemote = $null
|
||||||
|
$buildkitConfig = Join-Path $repoRoot 'deploy/buildkitd.toml'
|
||||||
|
|
||||||
function Invoke-Native {
|
function Invoke-Native {
|
||||||
param(
|
param(
|
||||||
@ -89,7 +91,12 @@ try {
|
|||||||
docker buildx inspect $BuilderName 2>$null | Out-Null
|
docker buildx inspect $BuilderName 2>$null | Out-Null
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
Invoke-Native {
|
Invoke-Native {
|
||||||
docker buildx create --name $BuilderName --driver docker-container --use | Out-Null
|
docker buildx create `
|
||||||
|
--name $BuilderName `
|
||||||
|
--driver docker-container `
|
||||||
|
--driver-opt "image=$BuildkitImage" `
|
||||||
|
--buildkitd-config $buildkitConfig `
|
||||||
|
--use | Out-Null
|
||||||
} '创建项目专属 BuildKit 构建器失败。'
|
} '创建项目专属 BuildKit 构建器失败。'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user