Skip to content

Commit d071df7

Browse files
committed
Updated to Docker 0.12, we do not need a custom bridge or other changes anymore
1 parent 2159158 commit d071df7

File tree

3 files changed

+19
-40
lines changed

3 files changed

+19
-40
lines changed

Dockerfile

+9-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get -y install git openjdk-7-jre-headless
1717
RUN git clone https://github.com/xbmc/xbmc.git -b Frodo --depth=1
1818

1919
# Install xbmc dependencies
20-
RUN (apt-get install -y build-essential gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound2-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs python-dev libyajl-dev libboost-thread-dev libplist-dev libusb-dev libudev-dev libtinyxml-dev libcap-dev autopoint libltdl-dev swig libgtk2.0-bin libtag1-dev libtiff-dev libnfs1 libnfs-dev)
20+
RUN (apt-get install -y build-essential gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound2-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs python-dev libyajl-dev libboost-thread-dev libplist-dev libusb-dev libudev-dev libtinyxml-dev libcap-dev autopoint libltdl-dev swig libgtk2.0-bin libtag1-dev libtiff-dev libnfs1 libnfs-dev wget)
2121

2222
ADD src/fixcrash.diff xbmc/fixcrash.diff
2323
ADD src/make_xbmc-server xbmc/xbmc/make_xbmc-server
@@ -31,13 +31,20 @@ RUN (cd xbmc && git apply fixcrash.diff)
3131
#Configure, make, clean
3232
RUN (cd xbmc && ./bootstrap && ./configure --enable-nfs --enable-upnp --enable-shared-lib --disable-debug --disable-vdpau --disable-vaapi --disable-crystalhd --disable-vdadecoder --disable-vtbdecoder --disable-openmax --disable-joystick --disable-xrandr --disable-rsxs --disable-projectm --disable-rtmp --disable-airplay --disable-airtunes --disable-dvdcss --disable-optical-drive --disable-libbluray --disable-libusb --disable-libcec --disable-libmp3lame --disable-libcap --disable-dbus && make -j2 && cp libxbmc.so /lib && ldconfig && cd xbmc && make -f make_xbmc-server all && make -f make_xbmcVideoLibraryScan all && mkdir -p /opt/xbmc-server/portable_data/ && cp xbmc-server xbmcVideoLibraryScan /opt/xbmc-server && cd .. && cp -R addons language media sounds system userdata /opt/xbmc-server/ && cd / && rm -rf /xbmc)
3333

34+
#Fix for XBMC not being able to choose its own network binding interface. Will force the webserver/eventserver/upnpserver to use the specified ip if LD_PRELOAD and BIND_ADDR are given as environment variables. See README.MD for further info
35+
RUN (cd /opt/xbmc-server && wget http://www.ryde.net/code/bind.c.txt -O bind.c && gcc -nostartfiles -fpic -shared bind.c -o bind.so -ldl -D_GNU_SOURCE)
36+
3437
#remove everything, clean cache, remove java.
3538
RUN (apt-get purge -y --auto-remove git openjdk* build-essential gcc gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound2-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs python-dev libyajl-dev libboost-thread-dev libplist-dev libusb-dev libudev-dev libtinyxml-dev libcap-dev autopoint libltdl-dev swig libgtk2.0-bin libtag1-dev libtiff-dev libnfs-dev && apt-get -y autoremove)
3639

3740
#install only dependencies for running xbmc. Taken out of the list: libbluetooth3 libbluray1. Put in the list: libssh-4 libtag1c2a libcurl3-gnutls libnfs1
3841
RUN (apt-get install -y fonts-liberation libaacs0 libasound2 libass4 libasyncns0 libavcodec53 libavfilter2 libavformat53 libavutil51 libcaca0 libcap2 libcdio13 libcec1 libcrystalhd3 libdrm-nouveau2 libenca0 libflac8 libfontenc1 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglew1.8 libglu1-mesa libgsm1 libhal-storage1 libhal1 libice6 libjson0 liblcms1 libllvm3.1 liblzo2-2 libmad0 libmicrohttpd10 libmikmod2 libmodplug1 libmp3lame0 libmpeg2-4 libmysqlclient18 liborc-0.4-0 libpcrecpp0 libplist1 libpostproc52 libpulse0 libpython2.7 libschroedinger-1.0-0 libsdl-mixer1.2 libsdl1.2debian libshairport1 libsm6 libsmbclient libsndfile1 libspeex1 libswscale2 libtalloc2 libtdb1 libtheora0 libtinyxml2.6.2 libtxc-dxtn-s2tc0 libva-glx1 libva-x11-1 libva1 libvdpau1 libvorbisfile3 libvpx1 libwbclient0 libwrap0 libx11-xcb1 libxaw7 libxcb-glx0 libxcb-shape0 libxmu6 libxpm4 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 libyajl2 mesa-utils mysql-common python-cairo python-gobject-2 python-gtk2 python-imaging python-support tcpd ttf-liberation libssh-4 libtag1c2a libcurl3-gnutls libnfs1 && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists /usr/share/man /usr/share/doc)
3942

4043
#Eventserver and webserver respectively.
41-
EXPOSE 9777/udp 8080/tcp
44+
EXPOSE 9777/udp 8089/tcp
45+
46+
#Preload bind which is used to bind xbmc to $BIND_ADDR. Use in combination with -e BIND_ADDR=ipaddress when running docker.
47+
#ENV LD_PRELOAD /opt/xbmc-server/bind.so
48+
#ENV BIND_ADDR 192.168.1.50
4249

4350
ENTRYPOINT ["/opt/xbmc-server/xbmc-server","--no-test","--nolirc","-p"]

README.md

+9-37
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ This will allow you to serve files through the XBMC UPnP Library to your UPnP cl
44

55
Docker is used to compile and run the latest headless version of XBMC Frodo
66

7-
This has been inspired by [Plex media server in Docker](http://blog.ostanin.org/2013/09/14/plex-media-server-in-docker/)
8-
97
This also includes some custom patches that will fix crashes. See the FAQ section for details.
108

11-
If you are running Docker 0.9+ look at the FAQ
12-
139
### Preqrequisites:
14-
* Docker version 0.8+ (See FAQ for 0.9+)
15-
* Optional, for UPnP to work: Set up a bridge. Your docker container must run on an IP that reaches your media players. See the [Setting up a network bridge section on this blog](http://blog.ostanin.org/2013/09/14/plex-media-server-in-docker/)
10+
* Docker version 0.12+
1611

1712
### Quick start
1813

@@ -51,26 +46,21 @@ If you are running Docker 0.9+ look at the FAQ
5146
Use this command in your automation scripts or in a crontab. Keep in mind that a library scan can take some time.
5247

5348
* __UPnP Server__:
54-
Required: See [Plex media server in Docker](http://blog.ostanin.org/2013/09/14/plex-media-server-in-docker/) on how to set up a bridge.
55-
56-
Pull from docker and run:
5749

58-
$ sudo docker run -d --networking=false \
50+
Run the following command to spawn a docker container running xbmc with UPnP:
51+
52+
$ sudo docker run -d --net=host --priviliged \
5953
-v /directory/with/xbmcdata:/opt/xbmc-server/portable_data \
60-
--lxc-conf="lxc.network.type = veth" \
61-
--lxc-conf="lxc.network.flags = up" \
62-
--lxc-conf="lxc.network.link = br0" \
63-
--lxc-conf="lxc.network.ipv4 = 192.168.1.49" \
64-
--lxc-conf="lxc.network.ipv4.gateway=192.168.1.1" \
54+
-e BIND_ADDR=192.168.1.50 -e LD_PRELOAD=/opt/xbmc-server/bind.so
6555
wernerb/docker-xbmc-server
6656
67-
Ps. Replace `br0`, `192.168.1.48` and `192.168.1.1` with the bridge interface, desired ip for container and your network gateway IP. Replace `/directory/with/xbmcdata` with the folder where you would like to store the xbmc data. Point it to the full path to the xbmcdata folder of this repository.
57+
Ps. Replace `192.168.1.50` with the IP to which you want to bind xbmc to, i.e., your host network ip. Replace `/directory/with/xbmcdata` with the folder where you would like to store the xbmc data. Point it to the full path to the xbmcdata folder of this repository.
6858

6959

7060
### Build the container yourself
7161
Execute:
7262

73-
docker build --rm=true -t wernerb/xbmc-server .
63+
docker build --rm=true -t $(whoami)/docker-xbmc-server .
7464

7565
Then proceed with the Quick start section.
7666

@@ -80,26 +70,8 @@ __Why Docker?__
8070
Docker ensures that xbmc-server can be run on multiple operating systems, as well as making xbmc-server portable. In the case of xbmc-server, a lot of people are having trouble compiling it to work in headless mode for different distributions. The steps to compile xbmc can be viewed in `Dockerfile` and lists the best practises found in this [xbmc forum thread](http://forum.xbmc.org/showthread.php?tid=132919).
8171

8272
__What do the patches do?__
83-
I discovered that the UPnP server in XBMC was very unstable, and crashed when browsing the library in headless mode. The problem was with thumbnail generation for some videos. The patches provided in this repo are automatically applied when compiling for headless mode, and allows xbmc to run without crashing.
84-
85-
__Getting veth errors?__
86-
You are most likely running docker 0.9 or higher that uses libcontainer and not lxc. Until lxc-conf veth commands work you can work around this by running docker with the following additonal arguments `-e lxc`.
87-
88-
* For Arch linux: you can find the file to add the arguments at:
89-
90-
/etc/systemd/system/multi-user.target.wants/docker.service
91-
92-
* For Ubuntu: open `/etc/default/docker` and uncomment and edit the following:
93-
94-
#DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4"
95-
to reflect:
96-
97-
DOCKER_OPTS="-e lxc"
98-
99-
Additionally you may need to install the lxc package, as it is no longer a dependency of Docker
100-
73+
I discovered that the UPnP server in XBMC was very unstable, and crashed when browsing the library in headless mode. The problem was with thumbnail generation for some videos. The patches provided in this repo are automatically applied when compiling for headless mode, and allows xbmc to run without crashing.
10174

10275
__What versions did you test this with?__
10376

104-
* Docker v0.9: XBMC (12.3 Git:20131212-9ed3e58)
105-
* Docker v0.7: XBMC (12.2 Git:20131204-5151fa8)
77+
* Docker v0.12: XBMC (12.3 Git:20131212-9ed3e58)

xbmcdata/userdata/advancedsettings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<upnpserver>true</upnpserver>
6969
<webserver>true</webserver>
7070
<webserverpassword>xbmc</webserverpassword>
71-
<webserverport>8080</webserverport>
71+
<webserverport>8089</webserverport>
7272
<webserverusername>xbmc</webserverusername>
7373
<webskin>webinterface.default</webskin>
7474
<zeroconf>true</zeroconf>

0 commit comments

Comments
 (0)