Code Monkey home page Code Monkey logo

Comments (13)

mrstegeman avatar mrstegeman commented on July 17, 2024

Seems like a permissions issue with the volume you mapped into the container. I believe the node user in the container has uid/gid of 1000/1000, so the owner of your mapped directory needs to match.

from gateway-docker.

NuroDev avatar NuroDev commented on July 17, 2024

That is odd as I am creating the container under the pi user which has an id of 1000 for both uid and gid.
I connected to the container and tried to manually create the directory, but to create it required sudo perms.
Is there a different perm I may be missing to allow it create the directory?

from gateway-docker.

dhylands avatar dhylands commented on July 17, 2024

I noticed that the directory you're trying to create is in /home/node and not /home/pi. I suspect that the permissions on /home/node (and subdirectories) may not be correct. Having said that, I've not really used docker on the Pi, so ignore me if this is just noise.

from gateway-docker.

dhylands avatar dhylands commented on July 17, 2024

You definitely will need sudo permissions to create the /home/node directory, but that directory should be owned by a user and you shouldn't need sudo permissions to create sub directories under /home/node if you're running as the owner.

from gateway-docker.

mrstegeman avatar mrstegeman commented on July 17, 2024

@dhylands In the docker container, node is the primary user, so that directory already exists.

from gateway-docker.

mrstegeman avatar mrstegeman commented on July 17, 2024

@NuroDev What command are you using to start the container? I have a Raspberry Pi to test with again, so I'd like to try to reproduce.

from gateway-docker.

NuroDev avatar NuroDev commented on July 17, 2024

Using docker-compose, but same issue when running default provided command in README.md.

docker-compose.yml

version: "2"

services:
  gateway:
    image: 	mozillaiot/gateway:arm
    container_name: gateway
    restart: always
    network_mode: host
    cap_add:
      - NET_ADMIN
    volumes:
      - /home/nuro/gateway/:/home/node/.mozilla-iot

from gateway-docker.

mrstegeman avatar mrstegeman commented on July 17, 2024

@NuroDev Why are you using /home/nuro/gateway? I thought you were running as the pi user? In that case, it should be /home/pi/gateway.

from gateway-docker.

NuroDev avatar NuroDev commented on July 17, 2024

My mistake, I mean't to say /home/pi/gateway. I usually use a .env file to store volume paths but for the sake commenting just manually input it 😅

from gateway-docker.

mrstegeman avatar mrstegeman commented on July 17, 2024

Haha, ok. So with /home/pi/gateway, it's still broken? Can you paste the output of stat /home/pi/gateway?

from gateway-docker.

NuroDev avatar NuroDev commented on July 17, 2024
  File: /home/pi/gateway/
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 802h/2050d      Inode: 255185      Links: 4
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-10-06 22:48:36.349122726 +0000
Modify: 2018-10-07 00:00:05.970806589 +0000
Change: 2018-10-07 00:00:05.970806589 +0000
 Birth: -

from gateway-docker.

mrstegeman avatar mrstegeman commented on July 17, 2024

The directory is owned by root. This should fix your issue:

chown -R 1000:1000 /home/pi/gateway

from gateway-docker.

NuroDev avatar NuroDev commented on July 17, 2024

That seemed to fix perfectly! Thank you ❤️ 😄

from gateway-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.