Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker support #118

Open
day1118 opened this issue Jun 24, 2022 · 0 comments
Open

Docker support #118

day1118 opened this issue Jun 24, 2022 · 0 comments

Comments

@day1118
Copy link

day1118 commented Jun 24, 2022

I would like to package an application that can access mouse movement as a docker container. It is possible to pass many other devices (webcams etc) to docker by mounting them as volumes/devices. Unfortunately, when I attempt that here, I receive a seg fault, but cannot determine how to troubleshoot it.

Why docker?
It is an easy way to develop on any machine, and then test/deploy anywhere.

Reproducing the issue
This can easily be reproduced by creating the following files:

# main.py
import mouse
print(mouse.get_position())
# Dockerfile
FROM python:3.9.13
WORKDIR /app
RUN pip3 install mouse
COPY main.py ./
CMD [ "python", "./main.py"]
# docker-compose.yaml
version: "3.3"
services:
  pymouse:
    build: .
    privileged: true
    devices:
      - /dev/mouse0

Then simply run docker-compose up and the app will exit with code 139 (128+ 11)
The log shows Segmentation fault (core dumped)

When I run dmesg, I see the following:

[ 7377.836267] python3[21490]: segfault at e0 ip 00007f2db4688000 sp 00007ffcf9085a98 error 4 in libX11.so.6.4.0[7f2db4672000+8c000]
[ 7377.836278] Code: 07 48 03 b7 e8 00 00 00 48 8b 46 10 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 8b 87 e0 00 00 00 c3 66 0f 1f 84 00 00 00 00 00 <48> 63 87 e0 00 00 00 48 c1 e0 07 48 03 87 e8 00 00 00 48 8b 40 10

Any thoughts on how to investigate this?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant