From eeb60b64af4aa0684b04eb2cb85072a12a20981c Mon Sep 17 00:00:00 2001 From: MaxKless <34165455+MaxKless@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:40:07 +0300 Subject: [PATCH] fix(core): enable using the daemon in docker if enabled explicitly (#27585) ## Current Behavior The daemon is hard-disabled in docker, even if you try to explicilty enable it using the `NX_DAEMON` env var. ## Expected Behavior We should disable the daemon by default in docker but allow users to opt-in using the env var. There might be issues that come with that but since it's opt-in, it will be at their own risk. ## Related Issue(s) Fixes https://github.com/nrwl/nx/issues/14126 --- packages/nx/src/daemon/client/client.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/nx/src/daemon/client/client.ts b/packages/nx/src/daemon/client/client.ts index e6f664435d..b0b633ea92 100644 --- a/packages/nx/src/daemon/client/client.ts +++ b/packages/nx/src/daemon/client/client.ts @@ -131,10 +131,13 @@ export class DaemonClient { // CI=true,env=undefined => no daemon // CI=true,env=false => no daemon // CI=true,env=true => daemon + + // docker=true,env=undefined => no daemon + // docker=true,env=false => no daemon + // docker=true,env=true => daemon // WASM => no daemon because file watching does not work if ( - (isCI() && env !== 'true') || - isDocker() || + ((isCI() || isDocker()) && env !== 'true') || isDaemonDisabled() || nxJsonIsNotPresent() || (useDaemonProcessOption === undefined && env === 'false') ||