I have installed docker, running a node-red image.
Can anybody tell me where the user (seems to be node-red / default setting) home directory is located when I let node-red write a file? It seems to work, since the file is still there even if I restart the image… but I can’t find the file when I go down to DietPi, because the default directory /usr/src/node-red doesn’t exist…
am I right that in a “standard config” the container itself can have a volume (e.g. mounted as /data) but has also a location for “non persistent” data which is located - where?
I started / installed the container with a command like this:
So docker pulls the new image and I can access the volume /data inside the container. Node-RED is run under user “node-red”, and when I save some documents in the user’s storage - I can’t find the documents when I’m searching for it in the host machine - right?
You completely misunderstood how docker is working, could that be? Node is running inside the container only. There should be no node user existing outside the container. The data directory is the only one existing outside the container and this is one is locked at the volume location I shared above. For whatever happen inside the container, you would need to ask container developer.
Well…
Let me explain, what I see, and where my misunderstanding might be.
In Node-RED (inside the container) I can use a exec node to run external commands on the host system of Node-RED which is - in this case - the container. Running “whoami” gives me back “node-red”. So I think this should be the user who is running Node-RED.
Now when I write a file in this user’s context, I can do it - of course - to the mounted volume /data, but I can also write a file just where I am (as user node-red) > but you’re right: I should ask at node-red, where the docker image comes from…
As said, what happen inside the container will stay inside the container. The only way to share files between container and outside world, is to use the Docker volume.