neko/.docker/base/intel/add-render-group.sh
Miroslav Šedivý 32472a70bc
Fix docker build (#237)
* include package-lock.

* extract intel gpu support from dockerfile.

* update arm support.

* new workflows.

* build intel images.

* add to docs.
2023-01-15 20:38:29 +01:00

19 lines
488 B
Bash
Executable File

#!/bin/bash
# if no hwenc required, noop
[[ -z "$NEKO_HWENC" ]] && exit 0
if [[ -z "$RENDER_GID" ]]; then
RENDER_GID=$(stat -c "%g" /dev/dri/render* | tail -n 1)
# is /dev/dri passed to the container?
[[ -z "$RENDER_GID" ]] && exit 1
fi
# note that this could conceivably be a security risk...
cnt_group=$(getent group "$RENDER_GID" | cut -d: -f1)
if [[ -z "$cnt_group" ]]; then
groupadd -g "$RENDER_GID" nekorender
cnt_group=nekorender
fi
usermod -a -G "$cnt_group" "$USER"