News for hackers. Stuff that matters.
Re:Running GUI apps within Docker containers by paskozdilar on Saturday March 26, 2022 @06:14AM (#30810615)
Thanks, this is much simpler than the original post.

Here's the equivalent Dockerfile + docker-compose.yaml for convenience:

    # Dockerfile
    FROM debian:11-slim
    RUN apt-get -y update && apt-get -y install firefox-esr 
    CMD ["firefox"]


    # docker-compose.yaml
    services:
      firefox:
        image: firefox
        build: .
        environment:
          DISPLAY: ${DISPLAY}
        network_mode: host
        volumes:
          - ${XAUTHORITY}:/root/.Xauthority
          - /tmp/.X11-unix:/tmp.X11-unix

This way you can run it with just:

    docker-compose up
Re:Running GUI apps within Docker containers by moody5bundle on Saturday March 26, 2022 @09:10AM (#30811510)
if you want to remove network_mode=host you need to run firefox with the --no-xshm flag