Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


if you want to remove network_mode=host you need to run firefox with the --no-xshm flag




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: