Giter Club home page Giter Club logo

Comments (6)

rcarmo avatar rcarmo commented on August 21, 2024 1

I stumbled upon this while looking for close matches to #109, so here's a docker-compose snippet that matches the current user by using the UID environment variable:

node-red:
        hostname: flows
        image: "nodered/node-red-docker:0.20.5-slim-v10" # https://hub.docker.com/r/nodered/node-red-docker/tags
        restart: always
        user: ${UID} # this needs to be set so that node-red can match filesystem UIDs
        volumes:
            - /etc/localtime:/etc/localtime:ro
            - /dev/rtc:/dev/rtc:ro
            - ${HOME}/.config/node-red:/data
        ports:
           - "1880:1880"

Hope it's useful.

from node-red-docker.

dawidcrivelli avatar dawidcrivelli commented on August 21, 2024

Sure, you can run docker run -u UID, for example zero for root

from node-red-docker.

AnderssonPeter avatar AnderssonPeter commented on August 21, 2024

Is there someway to do this with docker compose?

from node-red-docker.

dawidcrivelli avatar dawidcrivelli commented on August 21, 2024

@AnderssonPeter, yes, you can add a user line in the instance in the docker-compose file: https://medium.com/redbubble/running-a-docker-container-as-a-non-root-user-7d2e00f8ee15

from node-red-docker.

RezzZ avatar RezzZ commented on August 21, 2024

I also had to add the user for NodeRED before I could start nodered on my raspberry pi but a different issue then occurs when I try to install packages:

Unhandled rejection Error: EACCES: permission denied, mkdir '/.npm'

as .npm is a local folder inside the container nodered shouldn't have any issues creating it right?

edit: trying to sudo the folder via shell gives me the error:
sudo: unknown uid 1001: who are you?

temp solution:
#70 (comment)

remove the user from docker-compose and chmod your local data folder to 777

from node-red-docker.

RaymondMouthaan avatar RaymondMouthaan commented on August 21, 2024

Node-RED 1.0.0 is now available on docker hub - https://hub.docker.com/r/nodered/node-red.

This closes this issue.

There are a few changes to the new release, please read the README for further details.

from node-red-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.