You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance build scripts: add SnapshotRepo switch to Build.ps1 for temporary repo builds and improve DockerBuild.ps1 with dynamic CPU allocation and memory settings.
Memory and CPU limits only apply to hyperv isolation.
79
79
80
80
.PARAMETERMemory
81
-
Docker memory limit (e.g., "8g"). Only used with hyperv isolation. Defaults to 24g.
81
+
Docker memory limit (e.g., "8g"). Only used with hyperv isolation.
82
+
Defaults to $env:BuildAgentMemory (an integer in GB) if set, otherwise 24g.
82
83
83
84
.PARAMETERCpus
84
-
Docker CPU limit. Defaults to the host processor count. Only used with hyperv isolation.
85
+
Docker CPU limit. Use a positive integer for a static limit, or "dynamic" for
86
+
automatic allocation that rebalances CPUs across all managed containers.
87
+
Only used with hyperv isolation (static) or any isolation (dynamic).
88
+
Defaults to $env:BuildAgentCpus if set, otherwise the host processor count.
85
89
86
90
.PARAMETERMount
87
91
Additional directories to mount from the host (readonly by default, append :w for writable).
@@ -143,8 +147,8 @@ param(
143
147
[string]$RegistryImage,# Use a pre-built image from a registry, skipping Dockerfile build entirely.
144
148
[switch]$NoInit,# Do not generate or call Init.g.ps1 (skips git config, safe.directory, etc).
145
149
[string]$Isolation='hyperv',# Docker isolation mode (process or hyperv). Memory/CPU limits only apply to hyperv.
146
-
[string]$Memory='24g',# Docker memory limit (e.g., "8g"). Only used with hyperv isolation.
147
-
[int]$Cpus= [Environment]::ProcessorCount,# Docker CPU limit. Only used with hyperv isolation.
150
+
[string]$Memory=$(if ($env:BuildAgentMemory) { "${env:BuildAgentMemory}g" } else { '24g' }),# Docker memory limit (e.g., "8g"). Only used with hyperv isolation. Defaults to $env:BuildAgentMemory (in GB) or 24g.
151
+
[string]$Cpus=$(if ($env:BuildAgentCpus) { $env:BuildAgentCpus } else { [Environment]::ProcessorCount }),# Docker CPU limit. Use a positive integer or "dynamic". Defaults to $env:BuildAgentCpus or host processor count.
148
152
[string[]]$Mount,# Additional directories to mount from host (readonly by default, append :w for writable). Supports * and ** glob patterns.
149
153
[string[]]$Env,# Additional environment variables to pass from host to container.
150
154
[string[]]$Ports,# Port mappings from host to container (e.g., "8080:80", "3000").
@@ -164,6 +168,7 @@ if ($PSVersionTable.PSVersion -lt [Version]'7.5')
164
168
# These settings are replaced by the generate-scripts command.
0 commit comments