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

Add permissions on HV transcoding devices in docker container #2868

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ COPY --from=builder /gerbera_build/scripts/docker/docker-entrypoint.sh /usr/loca

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

Expand Down
20 changes: 20 additions & 0 deletions scripts/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ if [ ! -f /var/run/gerbera/config.xml ]; then
<\/autoscan>/' -i /var/run/gerbera/config.xml
fi

if [ -e /dev/video10 ]; then
# Add permission to all users on /dev/video10 device
chown root:video /dev/video10
fi

if [ -e /dev/video11 ]; then
# Add permission to all users on /dev/video11 device
chown root:video /dev/video11
fi

if [ -e /dev/video12 ]; then
# Add permission to all users on /dev/video12 device
chown root:video /dev/video12
fi

if [ -e /dev/dri ]; then
# Add permission to all users on /dev/dri device
chown root:video /dev/dri
fi

# If we are root, chown home and drop privs
if [ "$1" = 'gerbera' -a "$(id -u)" = '0' ]; then
chown -R gerbera /var/run/gerbera
Expand Down