Comments (13)
This sounds like a host configuration issue. Let me explain.
docker containers don't have udev rules because containers don't do kernel things, and udevadm is most definitely a kernel process.
What you describe is typically caused when the host user that is running the docker/docker-compose commands not being part of the docker
(or whatever group the docker-daemon uses), dialout
and plugdev
groups on the host machine.
When you run a container (such as the default octoprint image) as a non-root user, you either have to add privileges to your docker command, or use the --privileged
flag and mount /dev:/dev
.
Can you verify that your host user has the groups above, and if so, can you share your docker-compose file?
from octoprint-docker.
from octoprint-docker.
$ ls -l /dev | grep ttyUSB
crw-rw---- 1 root dialout 188, 0 Aug 17 00:13 ttyUSB0
$ docker-compose exec octoprint bash -c 'ls -l /dev | grep ttyUSB'
crw-rw---- 1 root sudo 188, 0 Aug 16 23:57 ttyUSB0
I guess GID 27 just turned out to be sudo
inside a container, that's why granting sudo is not a universal solution.
I won't be making a network accessible container with python2.7 inside privledged either)
My temporary solution was to grant sudo though.
from octoprint-docker.
You may want to also consider trying out the new octoprint/octoprint:1.4.2-camera
image variant we just published yesterday. It uses a different permissions model that we'll be bringing to the main image variants over the next few days.
from octoprint-docker.
docker-compose.yml
version: '3.7'
services:
octoprint:
image: octoprint/octoprint
ports:
- 5000:5000
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
volumes:
- octoprint:/home/octoprint
volumes:
octoprint:
groups of a user running docker-compose
users wheel dialout tor networkmanager docker plugdev avahi
docker image info:
REPOSITORY TAG IMAGE ID CREATED SIZE
octoprint/octoprint latest c7e8e6e2fcf8 2 days ago 701MB
from octoprint-docker.
docker containers don't have udev rules because containers don't do kernel things, and udevadm is most definitely a kernel process.
I thought that udev doesn't work with guest groups (guest groups lose names in the host system, and mappings are implemented by docker)
from octoprint-docker.
I am probably wrong about fixing it by granting sudo
though. It might vary from system to system
from octoprint-docker.
What do you get when you run
ls /dev | grep tty
…
On Sun, Aug 16, 2020, 7:46 PM Cabia Rangris @.***> wrote: I am probably incorrect about fixing it with granting sudo though. It might vary from system to system — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#64 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZBLAKMOZRDTVV63TMNLJ3SBB4U3ANCNFSM4QBCTNOA .
In container:
tty
ttyUSB0
On host
tty
tty0..63
ttyS0..3
ttyUSB0
from octoprint-docker.
GID for ttyUSB0 is 27 in both.
from octoprint-docker.
Yeah, each OS has slightly different udev rules for serial, character, and USB devices. Adding to the group inside the container does nothing really, it's all about the host.
from octoprint-docker.
I will be including a section on setting up your host in the new docs, and this is a good reminder to put in a section around groups and permissions of the user running octoprint and those of the device attached to the container.
from octoprint-docker.
Also, don't think that just because I closed this PR that your contributions aren't welcome. I just want to make sure we know what problems we're solving so we can consider what problems we might also be causing so that we can add those things to our testing (which is also coming soon). 😃
There is a dev-docker
channel on the official OctoPrint Discord if you ever want to chat in real time, or consult on development.
from octoprint-docker.
from octoprint-docker.
Related Issues (20)
- marlin-binary-protocol missing
- Config_Directory not properly initiated HOT 3
- Q: what is the preffered method of updating the octoprint-docker container? HOT 1
- [BUG] octoprint/octoprint:latest or :1.8.6 not up to date HOT 4
- Q: octoprint-docker on Windows HOT 2
- Multiple Webcam Support
- [BUG] Multi camera support uses wrong port HOT 1
- Can't get webcam working
- Multiple processes of mjpg streamer started HOT 7
- [BUG] Webassets are not loaded when X-Script-Name is set HOT 3
- [BUG] Loading error: Passive login failed. raspi 4 HOT 8
- Docker container with camera-streamer HOT 3
- Shutdown/Reboot commands HOT 3
- [BUG] `undefined` tag is present on Dockerhub HOT 1
- AttributeError: 'Babel' object has no attribute 'app' HOT 5
- [BUG] validating /<path>/docker-compose.yml: (root) Additional property payload is not allowed HOT 2
- upgrade to bookworm release python HOT 3
- [BUG] and proposed fix for "PermissionError: [Errno 1] Operation not permitted" due to libseccomp2 HOT 1
- [BUG] mjpg_steamer fails and needs to be restarted
- Q: How do I use with CasaOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octoprint-docker.