How to tunnel a docker X windows to a remote host? How to tunnel a docker X windows to a remote host? docker docker

How to tunnel a docker X windows to a remote host?


I got something to work following the instructions at https://dzone.com/articles/docker-x11-client-via-ssh.

My docker-compose has:

version: "3.7"services:  rhel:    privileged: true    build:      context: /home/mpawlowsky/docker      dockerfile: Dockerfile    volumes:      - /tmp/.x11-unix:/tmp/.x11-unix      - /home/mpawlowsky/.Xauthority:/root/.Xauthority:rw    cap_add:      - NET_ADMIN      - NET_RAW    environment:      - DISPLAY    network_mode: host

I start the container and run in it:

$ docker-compose up -d$ docker exec -it rhel /bin/bash$ firefox