Closed NuroDev closed 6 years ago
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.
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?
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.
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.
@dhylands In the docker container, node is the primary user, so that directory already exists.
@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.
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
@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
.
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 😅
Haha, ok. So with /home/pi/gateway
, it's still broken? Can you paste the output of stat /home/pi/gateway
?
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: -
The directory is owned by root. This should fix your issue:
chown -R 1000:1000 /home/pi/gateway
That seemed to fix perfectly! Thank you ❤️ 😄
Ran the provided script for ARM devices (Running on a Raspberry Pi Model 3 B) and container starts successfully with no errors on launch. However when checking the logs, the logs are spammed with the error below:
Is there something I am doing wrong or an issue with the image?