shantanoo-desai / komponist

A Composer for your favorite IoT/ IIoT container stacks with Ansible + Jinja2 + Docker Compose v2
GNU Affero General Public License v3.0
25 stars 2 forks source link

Node-RED container has no permission #68

Closed gintasjuk closed 1 year ago

gintasjuk commented 1 year ago

When using Komponist to generate stack on remote ARM device, Node-RED container fails to start. Node-RED log shows: admin@ubuntu:~/deploy$ docker logs komponist_nodered 7 May 14:20:46 - [error] Failed to start server: 7 May 14:20:47 - [error] Error: EACCES: permission denied, mkdir '/.node-red'

In docker-compose file, removing user: "1001" and adding: privileged: true fixes the issue, but not sure if this is a correct solution.

shantanoo-desai commented 1 year ago

This is because the default node-red container has a user nodered which is assigned the 1000 user ID and the user ID on the host is 1001 (which does not exist in the container), hence causing the problem of permissions.

gintasjuk commented 1 year ago

Changing user ID to 1000 indeed fixes the problem. Just not sure how to fix the logic in the template so that proper ID is assigned.

shantanoo-desai commented 1 year ago

@gintasjuk You can set the value of user id in the vars/comfig.yml file, see:

https://github.com/shantanoo-desai/komponist/blob/main/vars/config.yml#L39