justb4 / docker-jmeter

Docker image for Apache JMeter
MIT License
278 stars 310 forks source link

Support request - how to run with X11? #60

Open lpeabody opened 2 years ago

lpeabody commented 2 years ago

Thanks for the useful Docker image. I'm just diving into JMeter for a project and I'd like to be able to run the GUI to help build the tests, but then run them via command line. How would one go about running this container and using the GUI through X11?

otheus commented 2 years ago

The answer depends on what kind of host your docker is running on.

Here is an example of how I use justb4/jmeter with MacOS running 12.3 (Monterey).

  1. Install XQuartz. A reboot might be necessary.
  2. In XQuartz, go to Properties/Security and check on allow connections from the network.
  3. Restart XQuartz.
  4. Verify with lsof -i TCP:6000. You should see output indicating that the xserver is listening to port 6000.
  5. Verify that all this works with: 5.1. export DISPLAY=localhost:0 5.2. xhost +localhost Note: On Linux, it might be something like xhost +172.17.0.1 or something. 5.3. xterm
  6. Launch docker and map in the X11 volume and DISPLAY environment variables: docker run -v /tmp/X11-unix:/tmp/.X11-unix -e DISPLAY=docker.for.mac.host.internal:0 justb4/jmeter

Currently, I'm finding it crashes after 5 minutes, but that might be due to issues in running a java/linux/docker/Mac interaction.