@tbrandenburg/node-red-cli 0.2.10 → 0.2.11
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 +1 -1
- package/src/docker-image.js +7 -0
package/package.json
CHANGED
package/src/docker-image.js
CHANGED
|
@@ -81,8 +81,15 @@ function derivedTag(image, version) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function derivedDockerfile(image, version) {
|
|
84
|
+
// Switch to root before the global npm install: many community/base
|
|
85
|
+
// images set a non-root default USER (e.g. `node`), which lacks write
|
|
86
|
+
// access to the global npm prefix and would otherwise fail with EACCES.
|
|
87
|
+
// The derived image is left running as root - restoring the original
|
|
88
|
+
// image's default user would require inspecting the base image at build
|
|
89
|
+
// time, which is out of scope here.
|
|
84
90
|
return [
|
|
85
91
|
`FROM ${image}`,
|
|
92
|
+
"USER root",
|
|
86
93
|
`RUN npm install -g @tbrandenburg/node-red-cli@${version}`,
|
|
87
94
|
`ENTRYPOINT ["node", "${SANDBOX_ENTRY_PATH}"]`,
|
|
88
95
|
""
|