A bit of context (for myself and whoever it might help):
- I've been using WebdriverIO (WDIO) to test Node.js-based web apps (and for other stuff too).
- WDIO has a nice Getting Started page. When you launch your WDIO-based tests or app, WDIO launches a browser (Chrome by default).
- Since my app became a kind of "microservices app" (one of them being the WDIO app), I wanted to use Docker to manage them.
Interesting stuff I found here and there:
- Running ROS with GUI in Docker using Windows Subsystem for Linux 2 (WSL2). This is the one line that helped me in this article:
docker run -it --name ros-test -e DISPLAY=host.docker.internal:0.0 -e LIBGL_ALWAYS_INDIRECT=0 osrf/ros:kinetic-desktop-full bash
- VcXsrv Windows X Server A Windows X-Server
- How to set up working X11 forwarding on WSL2.
I wanted to try running a simple X11 app from a Docker container.
I copy-pasted code from a tutorial (first link) and added a Dockerfile. I won't get into how to create a Dockerfile. It uses the latest Alpine image, installs g++
and libx11-dev
, compiles the app and runs it.
Since the containerized Linux had no display, the container shut down as soon as I first started it (I used Docker events
to make sure the error message was Cannot open display
.