From c9af8982551f903e634084b35b2597c98beed0ab Mon Sep 17 00:00:00 2001 From: Alex James Date: Mon, 15 Aug 2022 23:09:42 -0500 Subject: dockerTools.buildImage: make VM memSize configurable Fixes #186752. This adds buildVMMemorySize (defaults to 512 MiB) to buildImage, which is passed to vm.runInLinuxVM. This is needed for larger base images, which may otherwise cause container build failures due to OOM in the VM. --- doc/builders/images/dockertools.section.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/builders/images/dockertools.section.md b/doc/builders/images/dockertools.section.md index d8deb6cfbc8c4..6fdd4b5cadd38 100644 --- a/doc/builders/images/dockertools.section.md +++ b/doc/builders/images/dockertools.section.md @@ -36,6 +36,9 @@ buildImage { WorkingDir = "/data"; Volumes = { "/data" = { }; }; }; + + diskSize = 1024; + buildVMMemorySize = 512; } ``` @@ -59,6 +62,10 @@ The above example will build a Docker image `redis/latest` from the given base i - `config` is used to specify the configuration of the containers that will be started off the built image in Docker. The available options are listed in the [Docker Image Specification v1.2.0](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions). +- `diskSize` is used to specify the disk size of the VM used to build the image in megabytes. By default it's 1024 MiB. + +- `buildVMMemorySize` is used to specify the memory size of the VM to build the image in megabytes. By default it's 512 MiB. + After the new layer has been created, its closure (to which `contents`, `config` and `runAsRoot` contribute) will be copied in the layer itself. Only new dependencies that are not already in the existing layers will be copied. At the end of the process, only one new single layer will be produced and added to the resulting image. -- cgit 1.4.1