We are very familiar with running CLI processes in Docker containers with no Graphical UI at all. Here is an example using zenika/alpine-chrome with a X11 server
First, install the pre following this great article
brew install socat
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
brew cask install xquartz
Open Xquartz
open -a Xquartz
Activate the option ‘Allow connections from network clients’ in XQuartz settings. Quit & restart Xquartz.
One important thing to note is that after you have installed this is to log out and log back into OS X to get everything to work properly. Once that is done we can start Xquartz.
docker container run --rm -it -e DISPLAY=host.docker.internal:0 --cap-add=SYS_ADMIN --entrypoint "" zenika/alpine-chrome:with-webgl chromium-browser --disable-dev-shm-usage
Launch this command to check your X11 setup:
docker container run --rm -it -e DISPLAY=host.docker.internal:0 gns3/xeyes
If you got this error:
[1:1:0507/061725.810254:ERROR:browser_main_loop.cc(1512)] Unable to open X display.
Then your X11 server might not be configured in your container.