File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ interface BuildImageDockerOptions extends DockerOptions {
2121 delete ?: boolean
2222 push ?: boolean
2323 target ?: string
24+ // build命令时,GC限制内存大小
25+ memory ?: number
2426}
2527
2628/**
@@ -139,8 +141,9 @@ export async function buildImage(args: BuildImageDockerOptions) {
139141
140142 // 支持--target参数
141143 const targetParams = args . target != null ? `--target ${ args . target } ` : ''
144+ const memoryParams = args . memory != null ? `--memory=${ args . memory } mb` : ''
142145
143- const command = `docker build ${ buildArg } ${ targetParams } -t '${ args . imageName } ' .`
146+ const command = `docker build ${ buildArg } ${ targetParams } ${ memoryParams } -t '${ args . imageName } ' .`
144147
145148 if ( args . logger ) {
146149 vipLog . log ( `执行的命令:\n` , { startLabel : vipSymbols . success } )
You can’t perform that action at this time.
0 commit comments