libvlc_new null when running inside Docker
Posted: 17 Mar 2019 23:38
I have following basic sample code (just for testing in this case)
Now after building and running this on my host system (being Linux - specifically Ubuntu/Debian based) it runs fine and the VLC instance is created as expected. However when I run (and build) it inside a Docker container it is unable to create the vlc instance without showing any error or warning message.
For completion on this issue assume the Docker image looks something like this
and is being run as follows
Anyone any ideas?
Code: Select all
#include <vlc/vlc.h>
int main(int argc, char* argv[]) {
libvlc_instance_t* inst = libvlc_new(0, NULL);
printf("%p\n", inst);
return 0;
}
For completion on this issue assume the Docker image looks something like this
Code: Select all
FROM debian:stretch
RUN apt-get install libgtk-3-dev libgtk-3-0 libcurl4-openssl-dev sudo -y
RUN apt-get install -y libvlc-dev
RUN apt-get remove -y libgtk2.0-0 && apt-get autoremove -y
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 && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown ${uid}:${gid} -R /home/developer && \
chown ${uid}:${gid} -R /app
USER developer
Code: Select all
docker run -e DISPLAY=:0.0 -v /tmp/.X11-unix:/tmp/.X11-unix -it my/image /bin/bash