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

Docker image usability #2996

Merged
merged 5 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ RUN addgroup -S gerbera 2>/dev/null && \
adduser -S -D -H -h /var/run/gerbera -s /sbin/nologin -G gerbera -g gerbera gerbera 2>/dev/null && \
addgroup gerbera video && \
mkdir /var/run/gerbera/ && chmod 2775 /var/run/gerbera/ && \
mkdir /content && chmod 777 /content
mkdir /content && chmod 777 /content && ln -s /content /mnt/content && \
KarlStraussberger marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p /mnt/customization/js && mkdir -p /mnt/customization/shell && \
chmod -R 777 /mnt/customization

EXPOSE 49494
EXPOSE 1900/udp
Expand Down
12 changes: 8 additions & 4 deletions README.Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ e.g. `gerbera/gerbera:1.9.2-transcoding`. Includes tools such as ffmpeg and vlc.
$ docker run \
--name some-gerbera \
--network=host \
-v /some/files:/content:ro \
-v /some/files:/mnt/content:ro \
gerbera/gerbera:vX.X.X
```

Expand All @@ -51,22 +51,26 @@ services:
network_mode: host
volumes:
- gerbera-config:/var/run/gerbera
- /some/files:/content:ro
- /some/files:/mnt/content:ro

volumes:
gerbera-config:
external: false
```

The directory `/content` is automatically scanned for content by default.
The directory `/mnt/content` is automatically scanned for content by default.
Host networking enables us to bypass issues with broadcast across docker bridges.

You may place custom JavaScript files in the directory `/mnt/customization/js`.
Every time Gerbera creates `/var/run/gerbera/config.xml`, the shell script
`/mnt/customization/shell/gerbera_config.sh` (if existing) will be executed.

## Provide your own config file
```console
$ docker run \
--name another-gerbera \
--network=host \
-v /some/files:/content:ro \
-v /some/files:/mnt/content:ro \
-v /some/path/config.xml:/var/run/gerbera/config.xml \
gerbera/gerbera:vX.X.X
```
9 changes: 9 additions & 0 deletions scripts/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ if [ ! -f /var/run/gerbera/config.xml ]; then
<directory location="\/content" mode="inotify" \
recursive="yes" hidden-files="no"\/>\n\
<\/autoscan>/' -i /var/run/gerbera/config.xml

# Add directory for custom JavaScript scripts
sed 's/<\/common>/<\/common>\
<custom>\/mnt\/customization\/js<\/custom>/' -i /var/run/gerbera/config.xml

# Allow customization of Gerbera configuration file
if [ -x /mnt/customization/shell/gerbera_config.sh ]; then
. /mnt/customization/shell/gerbera_config.sh
fi
fi

if [ -e /dev/video10 ]; then
Expand Down