Skip to content

[BUG] Build container isolation ignored #10056

@jhlgns

Description

@jhlgns

Description

I would like to build an windows-platform image that requires more than 1GB of RAM to build.
docker build --isolation=process . allows for more memory, but setting <service>.build.isolation: process for the docker-compose service seemingly gets ignored.

Steps To Reproduce

Dockerfile:

FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Get-WmiObject Win32_PhysicalMemory |% Capacity
docker build --no-cache .

Shows 1GB of memory (Hyper-V isolation default) - so like this it's not possible to build the image I want to build

docker build --no-cache --process=isolation .

Shows 32GB of memory - so it's possible to build the image

Using the following docker-compose.yml:

version: '3'
services:
  cowabunga:
    build:
      context: .
docker-compose build --no-cache

Shows 1GB of memory
Setting <service>.build.isolation:

version: '3'
services:
  cowabunga:
    build:
      context: .
      isolation: process
docker-compose build --no-cache

Still shows 1GB - impossible to build the image

NOTE: The Docker daemon is configured for the windows platform!

Compose Version

v2.12.2

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.12.2)
  dev: Docker Dev Environments (Docker Inc., v0.0.3)
  extension: Manages Docker extensions (Docker Inc., v0.2.13)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.21.0)

Server:
 Containers: 65
  Running: 13
  Paused: 0
  Stopped: 52
 Images: 638
 Server Version: 20.10.21
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 22000 (22000.1.amd64fre.co_release.210604-1628)
 Operating System: Windows 10 Enterprise Version 2009 (OS Build 22000.1219)
 OSType: windows
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.71GiB
 Name: REDACTED
 ID: REDACTED
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions