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

running under Docker in macOS with X11 #31

Open
PaulWieland opened this issue Feb 8, 2024 · 4 comments
Open

running under Docker in macOS with X11 #31

PaulWieland opened this issue Feb 8, 2024 · 4 comments

Comments

@PaulWieland
Copy link

Feature Request

Feature Description

Support for running under macOS with XQuartz (X11 window system for macOS)

Installation Method

I'm attempting to run in docker under macOS 14.1.2 with XQuartz.

$docker run   --net="host"   --privileged   --name survey   -it   --rm   -v $(pwd):/pwd   -w /pwd   -e DISPLAY=$DISPLAY   -v "$HOME/.Xauthority:/root/.Xauthority:ro"   jantman/python-wifi-survey-heatmap   wifi-survey -b DeckAP -i en0 -s 10.0.1.3 -p main_floor.png -t main_floor

Unable to access the X Display, is $DISPLAY set properly?

$ echo $DISPLAY

/private/tmp/com.apple.launchd.OoSO3ahrXN/org.xquartz:0

Testing Assistance

Yes, I can test.

@jantman
Copy link
Owner

jantman commented Feb 13, 2024

@PaulWieland Thanks for submitting this. Just as a heads up I don't use Mac, so I'm not really sure how much I can do for this. One guess, though, is that /private/tmp/com.apple.launchd.OoSO3ahrXN/org.xquartz is either a file or pipe/device, which maybe needs to be mounted in to the container?

I'd really need someone who knows more about Mac, and XQuartz specifically, to assist on this...

@PaulWieland
Copy link
Author

I have experience with docker, iperf, and some with python but none with python + x11. Is there a basic hello world example you could offer that I can use to figure out if python can interact with x11 under macOS?

@PaulWieland
Copy link
Author

PaulWieland commented Feb 13, 2024

I can natively run this program

import wx

app = wx.App()
window = wx.Frame(None, title = "wxPython Frame", size = (300,200))
panel = wx.Panel(window)
label = wx.StaticText(panel, label = "Hello World", pos = (100,50))
window.Show(True)
app.MainLoop()

and it correctly renders an X11 window.

Now to test under docker (or mount the $DISPLAY path in docker)

@PaulWieland
Copy link
Author

Mapped the display property like this:

docker run  \
	--net="host" \
	--privileged \
	--name survey \
	-it \
	--rm \
	-v $(pwd):/pwd \
        -v $(DISPLAY):/tmp/display \
	-w /pwd \
	-e DISPLAY=/tmp/display \
	-v "$HOME/.Xauthority:/root/.Xauthority:ro" \
	jantman/python-wifi-survey-heatmap \
	wifi-survey -b DeckAP -i en0 -s 10.0.1.3 -p main_floor.png -t main_floor

However it produces these errors which I haven't yet chased down:

DISPLAY: delegate library support not built-in '' (X11) @ error/display.c/DisplayImageCommand/1901.
docker: invalid reference format: repository name must be lowercase.

The docker error might be a simple syntax problem. The DISPLAY error might be more serious, but so far the only pages Ive found are related to Imagemagick which is unrelated afaik.

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

2 participants