master
Andy 7 years ago
parent d56432d796
commit 6e6290d822
Signed by: arno
GPG Key ID: 368DDA2E9A471EAC

@ -0,0 +1,31 @@
# Run VLC in a container
FROM ubuntu:xenial
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
# 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" ]

@ -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" "$@"
}
```

@ -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
Loading…
Cancel
Save