From 6e6290d822d7b586071d5e944f21927a409a06ae Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Wed, 14 Dec 2016 21:56:15 +0100 Subject: [PATCH] add vlc --- Dockerfile | 31 +++++++++++++++++++++++++++++++ README.md | 17 +++++++++++++++++ docker-compose.yml | 18 ++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ac53089 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# Run VLC in a container +FROM ubuntu:xenial +MAINTAINER Andrey Arapov + +# To avoid problems with Dialog and curses wizards +ENV DEBIAN_FRONTEND noninteractive + +# Install GTK, pulseaudio and fonts +RUN apt-get update && \ + apt-get -y --no-install-recommends install \ + ca-certificates \ + vlc && \ + rm -rf -- /var/lib/apt/lists + +# 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 + +ENV LC_ALL C.UTF-8 + +RUN useradd -u $UID -m -d $HOME -s /usr/sbin/nologin -G $GROUPS $USER +USER $USER +WORKDIR $HOME +ENTRYPOINT [ "vlc", "--no-metadata-network-access", "--no-qt-privacy-ask" ] diff --git a/README.md b/README.md new file mode 100644 index 0000000..b2aa100 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# VLC in Docker + + +``` +xhost +SI:localuser:$(id -un) + +function docker_helper() { + pushd ~/docker/$1 + docker-compose rm -f "$1" + docker-compose run -d --name "$1" "$@" + popd +} + +function vlc() { + docker_helper "$FUNCNAME" "$@" +} +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a672063 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '2' + +services: + vlc: + image: andrey01/vlc + network_mode: bridge + devices: + - /dev/dri + # - /dev/video0 + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix:ro + - $XDG_RUNTIME_DIR/pulse:/run/user/1000/pulse + - $HOME/Downloads:/home/user:ro + - /etc/localtime:/etc/localtime:ro + environment: + - DISPLAY=unix$DISPLAY + - PULSE_SERVER=unix:$XDG_RUNTIME_DIR/pulse/native + shm_size: 4G