Created
November 5, 2015 03:47
-
-
Save harai/e5020db0f23c496ccef5 to your computer and use it in GitHub Desktop.
Dockerfile which starts Google Chrome
This file contains hidden or 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
FROM ubuntu:14.04 | |
# | |
# Usage: | |
# docker build -t chrome . | |
# docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix chrome | |
# | |
# Created originally by: | |
# http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/ | |
# | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get install -y curl | |
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
RUN sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' | |
RUN apt-get update && apt-get install -y \ | |
google-chrome-stable \ | |
fonts-takao | |
# Replace 1000 with your user / group id | |
RUN export uid=1000 gid=1000 && \ | |
mkdir -p /home/developer && \ | |
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \ | |
echo "developer:x:${uid}:" >> /etc/group && \ | |
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \ | |
chmod 0440 /etc/sudoers.d/developer && \ | |
chown ${uid}:${gid} -R /home/developer | |
USER developer | |
ENV HOME /home/developer | |
CMD /usr/bin/google-chrome-stable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment