Skip to content

Instantly share code, notes, and snippets.

@hiviah
Last active February 1, 2016 13:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiviah/0b5b62cf7d163f7d9b9c to your computer and use it in GitHub Desktop.
Save hiviah/0b5b62cf7d163f7d9b9c to your computer and use it in GitHub Desktop.
Dockerfile for Chrome on Ubuntu
# Pull base image.
FROM ubuntu
# Setup user with the same UID/GID as on your host system to make X session work over socket
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 && \
chown ${uid}:${gid} -R /home/developer
# Install Chrome
RUN \
apt-get install -y wget && \
wget -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update && \
apt-get install -y google-chrome-stable
# Define working directory.
WORKDIR /home/developer
# Define default command.
CMD ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment