node-red / node-red/node-red-docker
group id not set in docker-custom/Dockerfile.custom (v1.1.3)
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 540
- Forks
- 434
- Avg merge
- 24m
- Merged PRs (30d)
- 5
Description
Hi, in docker-custom/Dockerfile.custom no group id is created or assigned to the user node-red. It defaults to the root group. This creates permission problems when running something like,
docker run --rm --user=$UID -it -p 1880:1880 -v /home/user/.node-red:/data --name mynodered nodered/node-red
as the permissions in the host directory /home/user/.node-red, become mangled.
Adding something like the following seems to address it,
: xps 0 %; git diff
diff --git a/docker-custom/Dockerfile.custom b/docker-custom/Dockerfile.custom
index 018648e..c084498 100644
--- a/docker-custom/Dockerfile.custom
+++ b/docker-custom/Dockerfile.custom
@@ -21,11 +21,10 @@ RUN set -ex && \
openssh-client && \
mkdir -p /usr/src/node-red /data && \
deluser --remove-home node && \
- adduser -h /usr/src/node-red -D -H node-red -u 1000 && \
- chown -R node-red:root /data && chmod -R g+rwX /data && \
- chown -R node-red:root /usr/src/node-red && chmod -R g+rwX /usr/src/node-red
- # chown -R node-red:node-red /data && \
- # chown -R node-red:node-red /usr/src/node-red
+ addgroup --gid 1001 node-red && \
+ adduser -h /usr/src/node-red -D -H node-red -u 1001 -G node-red && \
+ chown -R node-red:node-red /data && \
+ chown -R node-red:node-red /usr/src/node-red
# Set work directory
WORKDIR /usr/src/node-red
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docker-custom/Dockerfile.custom and compare the node-red user and group setup with the reported docker run command. Verify that the image assigns node-red to its own group and that the mounted /home/user/.node-red files no longer receive root-group permissions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100