Closed Jan-2005 closed 5 years ago
@Jan-2005 : it's wrong (i think :)
If you show logs for nodered's container with the command docker logs fhemdocker_nodered_1 --tail 40 --follow
you can show a "permission denied" error :
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.896050243' npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.896050243' npm ERR! at Error (native) npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'open', npm ERR! path: 'npm-debug.log.896050243' } npm ERR! npm ERR! Please try running this command again as root/Administrator.
it's a common error when using docker, we don't pay attention to which user on the host run the container.
There are multiples solutions :
args:
directive ) and used them in the Dockerfile (examples : RUN groupmod -g $USER_GID www-data && usermod -u $USER_UID www-data
OR RUN sed -i -e 's/fhem:.*/fhem:x:$USER_GID:20::\/opt\/fhem:\/bin\/bash/' /etc/passwd
)user
in order to associate the userId/groupId of the host and userId/groupId of the containerin your case the last solution is very easy, find your userId/groupId and set them in user
directive
For the userId
:
id -u 1000
For the groupId
:
id -g 1000
my user directive is user: "1000:1000"
Example :
version: '2' services: mqtt: restart: always expose: - "1883" - "9001" ports: - "1883:1883" - "9001:9001" image: toke/mosquitto networks: - fhem-network volumes: - ./mqtt/config/:/mqtt/config/ - ./mqtt/log/:/mqtt/log/ - ./mqtt/data/:/mqtt/data/ nodered: restart: always expose: - "1880" ports: - "1880:1880" image: nodered/node-red-docker:0.18.4 volumes: - ./nodered/data/:/data/ networks: - fhem-network depends_on: - "mqtt" user: "1000:1000" networks: fhem-network: driver: bridge
Nach langer suche habe ich das Problem endlich gefunden. Hinweiß für die anderen die das gleich Problem haben. Gruß Jan nodered: restart: always expose:
Habe es auf einem Ubuntu System laufen.