From 2da513262ab54a3bde5206f820f2f87fbb415fd7 Mon Sep 17 00:00:00 2001 From: Musicminion Date: Thu, 5 Nov 2026 01:11:53 +0800 Subject: [PATCH] Sandboxed compiles: apply the memory limit through HostConfig (#270) - Memory was set at the top level of the create options, which Docker ignores, so compile containers had no memory limit - Move it into HostConfig with the 1 GiB the comment intended (the old value was 1 TiB) --- services/clsi/app/js/DockerRunner.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/clsi/app/js/DockerRunner.mjs b/services/clsi/app/js/DockerRunner.mjs index 7739b02ffb..d7a5e73857 100644 --- a/services/clsi/app/js/DockerRunner.mjs +++ b/services/clsi/app/js/DockerRunner.mjs @@ -253,10 +253,11 @@ const DockerRunner = { ? Path.posix.join('/compile', cwd) : '/compile', NetworkDisabled: true, - Memory: 1024 * 1024 * 1024 * 1024, // 1 Gb User: Settings.clsi.docker.user, Env: Object.entries(env).map(([key, value]) => `${key}=${value}`), HostConfig: { + // Memory only takes effect inside HostConfig + Memory: 1024 * 1024 * 1024, // 1 Gb Binds: Object.entries(volumes).map( ([hostVol, dockerVol]) => `${hostVol}:${dockerVol}` ),