Skip to content

Instantly share code, notes, and snippets.

@Kuanlin-Chen
Created January 8, 2019 12:59
Show Gist options
  • Save Kuanlin-Chen/516c3155cb69e082518a253b7363f9fe to your computer and use it in GitHub Desktop.
Save Kuanlin-Chen/516c3155cb69e082518a253b7363f9fe to your computer and use it in GitHub Desktop.
Run Firefox in Docker with GUI.
FROM ubuntu:18.04
# docker build -t firefox .
# docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix firefox
# install firefox
# -y: assume yes as answer
RUN apt-get update && apt-get install -y firefox
# add user
RUN useradd -ms /bin/bash developer
# set the user as developer when running the image
USER developer
# set HOME directory
ENV HOME /home/developer
# provide default command for an executing container
CMD /usr/bin/firefox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment