@tbrandenburg/node-red-cli 0.2.11 → 0.2.12

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbrandenburg/node-red-cli",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Call existing Node-RED flows from Node.js and the command line",
5
5
  "main": "src/link-call.js",
6
6
  "bin": {
package/src/docker-run.js CHANGED
@@ -10,6 +10,8 @@
10
10
  * - `--rm -i` (always disposable, interactive stdin)
11
11
  * - `--network none`, unless `networkNeeded` (i.e. `--node-modules` is set)
12
12
  * - `--read-only` root filesystem + a `/tmp` tmpfs mount
13
+ * - `-e HOME=/tmp`, so tools needing a writable `$HOME` (config/cache dirs)
14
+ * land on the writable `/tmp` tmpfs instead of the read-only rootfs
13
15
  * - `--cap-drop=ALL`
14
16
  * - `--security-opt=no-new-privileges`
15
17
  *
@@ -35,6 +37,7 @@ function buildRunArgs(image, { networkNeeded, volumeName }) {
35
37
  const args = ["run", "--rm", "-i"];
36
38
  if (!networkNeeded) args.push("--network", "none");
37
39
  args.push("--read-only", "--tmpfs", "/tmp", "--cap-drop=ALL", "--security-opt=no-new-privileges");
40
+ args.push("-e", "HOME=/tmp");
38
41
  if (networkNeeded) {
39
42
  // --node-modules runs a real `npm install`, which needs a writable cache
40
43
  // dir; point it at the /tmp tmpfs since the root filesystem is read-only.