Docker permissions

Dear experts,
I run the dockerized version of node-red in a lubuntu 18.04LTS. In order to have storage persistance i run it the container as:
$ sudo docker run -it -p 1880:1880 -v /home/bsense/docker-persistent/nodered/data:/data --name mynodered nodered/node-red-docker

I have previously copied the container data files to the host directory:
$ sudo docker cp mynodered:/data /home/bsense/docker-persistent/nodered/

It starts coorectly but when i try to save the flows it gives an error of EACCESS
{Deploy failed: {ā€œerrorā€:ā€œEACCESā€,ā€œmessageā€:ā€œEACCES: permission denied, rename ā€˜/data/flows.jsonā€™ -> ā€˜/data/.flows.json.backupā€™ā€}

I would like to keep the host to managet he directory so I do not see any chown.

Within the container the uid is 1001 (nodered) the host user is 1000 (bsense)

This is kind annoying. It is not happenning to me with other conatinerized apps (mariadb, mongodb)

What could I do?

Regards

Hello,

Did you ever find a solution to this?

I am running the docker container within Kubernetes, and randomly getting this error. Nothing has changed about the deployment, it just suddenly shows up.

You can pass the effective user id to a pod with the following section in the Deployment yaml

spec:
  securityContext:
    runAsUser: 1000
    runAsGroup: 3000
    fsGroup: 2000

More details here

You can do the same with Docker using the --user flag on the command line (details here)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.