The goal is to run google-chrome in a docker container with audio support. I did this trying to get skype.apk to run in archron since skype for linux does not support conferencing anymore. Even if running skype in archron did not seemed to work chrome runs flawlessly with audio support via pulse:

So here is the Dockerfile:

<pre lang="bash">
FROM ubuntu:14.04
MAINTAINER len@len.ro

RUN apt-get update && apt-get install -y wget pulseaudio && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && apt-get update && apt-get install -y google-chrome-stable

RUN rm -rf /var/cache/apt/archives/*

RUN useradd -m -s /bin/bash chrome

USER chrome
ENV PULSE_SERVER /home/chrome/pulse
ENTRYPOINT [ "google-chrome" ]

You can build your container using:

<pre lang="bash">
docker build -t len/chrome .

The run it using:

<pre lang="bash">
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v $HOME/Downloads/chrome:/home/chrome/Downloads -v /run/user/$UID/pulse/native:/home/chrome/pulse -v /dev/shm:/dev/shm --name chrome len/chrome

Comments:

kerimit -

Your docker works great, but it consumes cpu when accessing youtube, I fix it by adding –device /dev/dri in the docker run parameter so you can use the gpu to play videos and reduce cpu


Good man -

# For easy reading # docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v $HOME/Downloads/chrome:/home/chrome/Downloads -v /run/user/$UID/pulse/native:/home/chrome/pulse -v /dev/shm:/dev/shm –name chrome len/chrome FROM ubuntu:14.04 MAINTAINER len@len.ro RUN apt-get update && apt-get install -y wget pulseaudio && echo “deb http://dl.google.com/linux/chrome/deb/ stable main” > /etc/apt/sources.list.d/google-chrome.list && wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && apt-get update && apt-get install -y google-chrome-stable RUN rm -rf /var/cache/apt/archives/* RUN useradd -m -s /bin/bash chrome USER chrome ENV PULSE_SERVER /home/chrome/pulse ENTRYPOINT [ “google-chrome” ]