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)
This commit is contained in:
Musicminion
2026-11-04 18:11:53 +01:00
committed by GitHub
parent 5c6ab5fad3
commit 2da513262a
+2 -1
View File
@@ -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}`
),