mercury-agent 0.4.17 → 0.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execFileSync, execSync, spawn } from "node:child_process";
|
|
1
|
+
import { execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
2
2
|
import { randomBytes } from "node:crypto";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path, { dirname } from "node:path";
|
|
@@ -389,12 +389,13 @@ let _isDockerDesktop: boolean | undefined;
|
|
|
389
389
|
function isDockerDesktop(): boolean {
|
|
390
390
|
if (_isDockerDesktop !== undefined) return _isDockerDesktop;
|
|
391
391
|
try {
|
|
392
|
-
const
|
|
392
|
+
const result = spawnSync("docker", ["info", "--format", "{{.Name}}"], {
|
|
393
393
|
encoding: "utf8",
|
|
394
394
|
timeout: 10_000,
|
|
395
395
|
stdio: ["pipe", "pipe", "pipe"],
|
|
396
|
-
})
|
|
397
|
-
|
|
396
|
+
});
|
|
397
|
+
const info = (result.stdout ?? "").trim();
|
|
398
|
+
_isDockerDesktop = result.status === 0 && info === "docker-desktop";
|
|
398
399
|
} catch {
|
|
399
400
|
_isDockerDesktop = false;
|
|
400
401
|
}
|
|
@@ -951,10 +952,10 @@ export class AgentContainerRunner {
|
|
|
951
952
|
"CONTAINER_RUNTIME=runsc",
|
|
952
953
|
);
|
|
953
954
|
} else if (this.config.containerBwrapDockerCompat || isDockerDesktop()) {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
955
|
+
logger.info("Enabling bwrap Docker compat (seccomp/apparmor/SYS_ADMIN)", {
|
|
956
|
+
configFlag: this.config.containerBwrapDockerCompat,
|
|
957
|
+
dockerDesktop: isDockerDesktop(),
|
|
958
|
+
});
|
|
958
959
|
args.push(
|
|
959
960
|
"--security-opt",
|
|
960
961
|
"seccomp=unconfined",
|