From bee40963d57faf6f8deeaf3aadff6c033189cbbb Mon Sep 17 00:00:00 2001 From: frostebite Date: Fri, 14 Aug 2026 20:20:23 +0100 Subject: [PATCH 1/2] feat: add dockerShmSize option to raise Docker's /dev/shm limit --- src/command-options/build-options.ts | 9 +++++++++ src/model/docker.ts | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/command-options/build-options.ts b/src/command-options/build-options.ts index 7dd74f8..f194e95 100644 --- a/src/command-options/build-options.ts +++ b/src/command-options/build-options.ts @@ -144,6 +144,15 @@ export class BuildOptions implements IOptions { demandOption: false, default: defaultDockerMemoryLimit(), }) + .option('dockerShmSize', { + description: String.dedent`Size of /dev/shm to assign the docker container, using the format + (m or g). Unity 6.6 beta / 6.7 alpha editors have been reported to fail with "Insufficient shared memory + available" against Docker's 64m default (see game-ci/unity-test-runner#307); leave unset to use Docker's + own default on older/stable editors that don't need it.`, + type: 'string', + demandOption: false, + default: '', + }) .option('dockerIsolationMode', { description: String.dedent`Windows only. Isolation mode to use for the docker container. Can be one of process, hyperv, or default. Default will pick the default mode as described by Microsoft where server diff --git a/src/model/docker.ts b/src/model/docker.ts index 2bd8dbd..cc87ceb 100644 --- a/src/model/docker.ts +++ b/src/model/docker.ts @@ -75,6 +75,7 @@ class Docker { useHostNetwork, dockerCpuLimit, dockerMemoryLimit, + dockerShmSize, } = options as Options & { commands?: string }; const home = homeDir; @@ -98,6 +99,7 @@ class Docker { sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : '', dockerCpuLimit ? `--cpus=${dockerCpuLimit}` : '', dockerMemoryLimit ? `--memory=${dockerMemoryLimit}` : '', + dockerShmSize ? `--shm-size=${dockerShmSize}` : '', useHostNetwork ? '--net=host' : '', `--volume "${home}":"/root:z"`, `--volume "${currentWorkDir}":"${dockerWorkspacePath}:z"`, @@ -128,6 +130,7 @@ class Docker { engine, dockerCpuLimit, dockerMemoryLimit, + dockerShmSize, dockerIsolationMode, } = options as Options & { commands?: string }; @@ -150,6 +153,7 @@ class Docker { ` --env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \``, dockerCpuLimit ? ` --cpus=${dockerCpuLimit} \`` : '', dockerMemoryLimit ? ` --memory=${dockerMemoryLimit} \`` : '', + dockerShmSize ? ` --shm-size=${dockerShmSize} \`` : '', dockerIsolationMode ? ` --isolation=${dockerIsolationMode} \`` : '', ` --volume="${currentWorkDir}":"c:${dockerWorkspacePath}" \``, isUnityDefaultFlow ? ` --volume="${cliStoragePath}/registry-keys":"c:/registry-keys" \`` : '', From 60cf2ba7406967ad96ac3d6f99c5e7a123d5889a Mon Sep 17 00:00:00 2001 From: frostebite Date: Fri, 14 Aug 2026 20:22:53 +0100 Subject: [PATCH 2/2] test: cover dockerShmSize on both linux and windows docker commands --- src/model/docker.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/model/docker.test.ts b/src/model/docker.test.ts index 39eead0..d5fe93f 100644 --- a/src/model/docker.test.ts +++ b/src/model/docker.test.ts @@ -81,14 +81,31 @@ describe('Docker', () => { engine: 'unity', dockerCpuLimit: '4', dockerMemoryLimit: '8192m', + dockerShmSize: '1024m', useHostNetwork: true, }); expect(command).toContain('--cpus=4'); expect(command).toContain('--memory=8192m'); + expect(command).toContain('--shm-size=1024m'); expect(command).toContain('--net=host'); }); + it('omits --shm-size when dockerShmSize is not set (game-ci/unity-test-runner#307)', () => { + const command = (Docker as any).getLinuxCommand('game-ci/unity-editor-stub:latest', { + hostOS: 'linux', + currentWorkDir: '/home/runner/work/cli/cli', + homeDir: '/home/runner', + cliDistPath: '/home/runner/work/cli/cli/dist', + sshAgent: '', + gitPrivateToken: '', + dockerWorkspacePath: '/github/workspace', + engine: 'unity', + }); + + expect(command).not.toContain('--shm-size'); + }); + it('mounts a custom SSH public keys directory instead of the known_hosts fallback', () => { const command = (Docker as any).getLinuxCommand('game-ci/unity-editor-stub:latest', { hostOS: 'linux', @@ -134,11 +151,13 @@ describe('Docker', () => { engine: 'unity', dockerCpuLimit: '4', dockerMemoryLimit: '8192m', + dockerShmSize: '1024m', dockerIsolationMode: 'process', }); expect(command).toContain('--cpus=4'); expect(command).toContain('--memory=8192m'); + expect(command).toContain('--shm-size=1024m'); expect(command).toContain('--isolation=process'); });