amanral/ubuntu-firefox

By amanral

Updated over 7 years ago

Firefox browser on top of official ubuntu 14.04 image

Image
1

162

  1. Aim: Add firefox browser to the official ubuntu 14.04 docker image to enable normal browsing from inside the container

  2. Usage: a. Direct firefox launching: docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/home/amanral/.Xauthority --net=host amanral/ubuntu-firefox:rev1

    b. Overriding with bash (to launch firefox manually from cmd line): docker run -it -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/home/amanral/.Xauthority --net=host amanral/ubuntu-firefox:rev1 /bin/bash

  3. Dockerfile for this image:

FROM ubuntu:14.04

RUN apt-get update && apt-get install -y firefox

#Replace below details with user / group id you would like to use RUN export uid=1000 gid=1000 &&
mkdir -p /home/amanral &&
echo "amanral:x:${uid}:${gid}:amanral,,,:/home/amanral:/bin/bash" >> /etc/passwd &&
echo "amanral:x:${uid}:" >> /etc/group &&
echo "amanral ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/amanral &&
chmod 0440 /etc/sudoers.d/amanral &&
chown ${uid}:${gid} -R /home/amanral

USER amanral ENV HOME /home/amanral CMD [ "/usr/bin/firefox" ]

Docker Pull Command

docker pull amanral/ubuntu-firefox