# Run Chrome in a container FROM ubuntu:xenial MAINTAINER Andrey Arapov # To avoid problems with Dialog and curses wizards ENV DEBIAN_FRONTEND noninteractive ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /tmp/google-talkplugin_current_amd64.deb ADD https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb /tmp/google-chrome-stable_current_amd64.deb RUN sh -c 'dpkg -i /tmp/google-chrome-stable_current_amd64.deb \ /tmp/google-talkplugin_current_amd64.deb 2>/dev/null; exit 0' && \ apt-get update && \ apt-get -fy install && \ apt-get install -y libcanberra-gtk-module libexif12 pulseaudio && \ rm -rf -- /var/lib/apt/lists /tmp/*.deb # Workaround: pulseaudio client library likes to remove /dev/shm/pulse-shm-* # files created by the host, causing sound to stop working. # To fix this, we either want to disable the shm or mount /dev/shm # in read-only mode when starting the container. RUN echo "enable-shm = no" >> /etc/pulse/client.conf ENV USER user ENV GROUPS video,audio ENV UID 1000 ENV HOME /home/$USER RUN useradd -u $UID -m -d $HOME -s /usr/sbin/nologin -G $GROUPS $USER && \ su -s /bin/sh -l $USER -c 'mkdir -p $HOME/.pki/nssdb $HOME/.local' USER $USER WORKDIR $HOME # Ephemeral volumes which will live as long as the container exists VOLUME [ "$HOME/.pki/nssdb", \ "$HOME/.local", \ "/tmp", \ "/data" ] # If you wish to have persistent volumes, then specify them in the docker-compose.yml # file at the `volumes:` section or with `-v` when using the `docker run` command ENTRYPOINT [ "/usr/bin/google-chrome", "--user-data-dir=/data" ] # "--no-sandbox"