Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize RPiPlay #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM debian:buster

# Download Raspberry firmware and unpack /opt/vc folder
ADD https://github.com/raspberrypi/firmware/archive/1.20200902.tar.gz /tmp/rpiplay/firmware.tar.gz

RUN cd /tmp/rpiplay && \
tar -xzvf firmware.tar.gz && \
cp -R ./firmware-1.20200902/opt/vc /opt/vc && \
rm -rf ./firmware-1.20200902

# Add sources
ADD . /tmp/rpiplay/RPiPlay-master

# Install essential dependencies
RUN cd /tmp/rpiplay && \
apt-get update && \
apt-get -y install cmake build-essential libavahi-compat-libdnssd-dev libplist-dev libssl-dev avahi-discover libnss-mdns

# Build RPiPlay
RUN cd /tmp/rpiplay/RPiPlay-master && \
mkdir build && \
cd build && \
cmake .. && \
make

WORKDIR /tmp/rpiplay/RPiPlay-master/build

# MISC settings
COPY ./avahi-daemon.conf /etc/avahi/avahi-daemon.conf

USER root
RUN mkdir -p /var/run/dbus

# Run container
EXPOSE 5353 51826
ENTRYPOINT ["/tmp/rpiplay/RPiPlay-master/build/rpiplay"]
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,34 @@ At the moment, these options are implemented:

**-v/-h**: Displays short help and version information.

# Docker

RPiPlay can be used in a docker environment

You can build an image from sources it using following command:
```
docker build . -t rpiplay:dev
```

Example docker-compose yaml for running it

```
---
version: "2.1"
services:
rpiplay:
container_name: rpiplay
image: rpiplay:dev
restart: always
network_mode: host
command: -n "test" -a off
volumes:
- /opt/vc:/opt/vc
- /var/run/dbus:/var/run/dbus
- /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket
devices:
- /dev/vchiq
```

# Disclaimer

Expand Down
71 changes: 71 additions & 0 deletions avahi-daemon.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

# See avahi-daemon.conf(5) for more information on this configuration
# file!

# https://linux.die.net/man/5/avahi-daemon.conf
# https://raw.githubusercontent.com/lathiat/avahi/master/avahi-daemon/avahi-daemon.conf

[server]
#host-name=foo
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=no
#allow-interfaces=eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]
#disable-publishing=no
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
#publish-hinfo=no
#publish-workstation=no
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
#publish-a-on-ipv6=no

[reflector]
#enable-reflector=no
#reflect-ipv=no

[rlimits]
#rlimit-as=
#rlimit-core=0
#rlimit-data=8388608
#rlimit-fsize=0
#rlimit-nofile=768
#rlimit-stack=8388608
#rlimit-nproc=3