Open johndsheehan opened 3 years ago
I have the same issue with 1.2.7. When I map /data
to a volume, the container fails to start:
nodered_1 | > node-red-docker@1.2.7 start /usr/src/node-red
nodered_1 | > node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
nodered_1 |
nodered_1 | fs.js:114
nodered_1 | throw err;
nodered_1 | ^
nodered_1 |
nodered_1 | Error: EACCES: permission denied, copyfile '/usr/src/node-red/node_modules/node-red/settings.js' -> '/data/settings.js'
nodered_1 | at Object.copyFileSync (fs.js:1728:3)
nodered_1 | at copyFile (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:68:8)
nodered_1 | at onFile (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:53:25)
nodered_1 | at getStats (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)
nodered_1 | at startCopy (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10)
nodered_1 | at handleFilterAndCopy (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10)
nodered_1 | at Object.copySync (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10)
nodered_1 | at Object.<anonymous> (/usr/src/node-red/node_modules/node-red/red.js:125:20)
nodered_1 | at Module._compile (internal/modules/cjs/loader.js:778:30)
nodered_1 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
nodered_1 | npm ERR! code ELIFECYCLE
nodered_1 | npm ERR! errno 1
nodered_1 | npm ERR! node-red-docker@1.2.7 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
nodered_1 | npm ERR! Exit status 1
nodered_1 | npm ERR!
nodered_1 | npm ERR! Failed at the node-red-docker@1.2.7 start script.
nodered_1 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The permissions for the host directory are root:root
, which I assume should be node-red:node-red
.
I was able to work around this issue by adding user: root to my docker-compose for node-red to force the container to run under root on the host.
Hi, in
docker-custom/Dockerfile.custom
no group id is created or assigned to the usernode-red
. It defaults to the root group. This creates permission problems when running something like,as the permissions in the host directory
/home/user/.node-red
, become mangled.Adding something like the following seems to address it,