Last active
October 21, 2024 22:58
-
-
Save jjo/b264473f3b21e52f6693bb9027046d72 to your computer and use it in GitHub Desktop.
Dockerfile to build a containerized `firefox` (under Debian), plus `run.sh` to run it -- READ THE DANGERS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker build -t firefox . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Debian Bookworm as the base image | |
FROM debian:bookworm-slim | |
# Update the package list and install necessary dependencies | |
RUN apt-get update && apt-get install -y \ | |
firefox-esr \ | |
libcanberra-gtk3-module \ | |
libdbus-glib-1-2 \ | |
libgtk-3-0 \ | |
libx11-xcb1 \ | |
libxt6 \ | |
libgl1 \ | |
libegl1 \ | |
libpci3 \ | |
--no-install-recommends \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set environment variables | |
ENV DEBIAN_FRONTEND=noninteractive \ | |
DISPLAY=:0 \ | |
LANG=en_US.UTF-8 \ | |
LANGUAGE=en_US:en \ | |
LC_ALL=en_US.UTF-8 \ | |
PULSE_SERVER=/run/pulse/native | |
# Set the default command to run Firefox | |
ENTRYPOINT ["firefox-esr"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DANGER!! this is only for testing purposes, `xhost +` will blindly open X11 to _anyone_ | |
xhost + | |
# DANGER#2 !! this RUNS AS ROOT, ONLY FOR TESTING PURPOSES, you've been warned | |
docker run -it --net=host --env=DISPLAY=unix$DISPLAY -v $HOME/.Xauthority:/root/.Xauthority:rw \ | |
-v /run/pulse:/run/pulse --device=/dev/dri --device=/dev/video0 --device=/dev/snd \ | |
-v /dev/shm:/dev/shm firefox \ | |
https://meet.jit.si/MeetingAZO$RANDOM | |
xhost - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment