mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
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:
@@ -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}`
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user