Skip to content

Commit

Permalink
Merge branch 'main' into pipewire
Browse files Browse the repository at this point in the history
  • Loading branch information
fat-tire committed Jun 14, 2022
2 parents 6f50f31 + 4897200 commit 58e19e5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ RUN echo "${USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-$USER

COPY "${ZIPNAME}" /tmp/DaVinci_Resolve_Linux.zip

# Note: for Arch & Manjaro distributions, we need to work around a potential AppImage "magic bytes" bug that may be in the run file
# see https://github.com/fat-tire/resolve/issues/16

RUN cd /tmp \
&& unzip *DaVinci_Resolve_Linux.zip \
&& if [ "`od -An -j 8 -N 6 -x --endian=big *DaVinci_Resolve_*_Linux.run`" = " 4149 0200 0000" ]; then \
sed '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' -i *DaVinci_Resolve_*_Linux.run; fi \
&& ./*DaVinci_Resolve_*_Linux.run --appimage-extract \
&& cd squashfs-root \
&& ./AppRun -i -a -y \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ Here are a few environment variables you can set when running `build.sh` and `re

* `RESOLVE_NETWORK` -- Set to "host" to use the host's Internet/network connectivity. Other network driver options are described in the [Docker](https://docs.docker.com/network/) and [Podman](https://docs.podman.io/en/latest/markdown/podman-run.1.html) documentation. The default is "none", meaning the container will not have network access.

* `RESOLVE_CONTAINER_ENGINE` -- Should you have *both* Podman and Docker installed in your host environment, Podman will always be used as your default. To specify a specific container engine, set `RESOLVE_CONTAINER_ENGINE` to either `podman` or `docker`.

* `RESOLVE_BIND_SOURCES` and `RESOLVE_BIND_TARGETS` -- Use these to add your own custom bindings from the host to the container.

Say you want to map `/tmp/garbage` on your host to `/tmp` in the container. You also want to map `/var/run/dbus/system_bus_socket` from the host to the container. You can do this like this.
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fi

echo "Building the resolve:${TAG} image..."

${CONTAINER_BUILD} -t "resolve:${TAG}" -t "resolve" --build-arg ARCH=`arch` --build-arg ZIPNAME="${ZIPNAME}" --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg NVIDIA_VERSION="${NVIDIA_VERSION}"
${CONTAINER_BUILD} -t "resolve:${TAG}" -t "resolve" --build-arg ARCH=`uname -m` --build-arg ZIPNAME="${ZIPNAME}" --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg NVIDIA_VERSION="${NVIDIA_VERSION}"

# remove any context link
if [ -f "${CONTEXT_ZIP}" ]; then
Expand Down
14 changes: 7 additions & 7 deletions env-set.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ fi

# determine if podman or docker installed

if ! command -v podman &> /dev/null; then
CONTAINER_TYPE="docker"
CONTAINER_BUILD="docker build ."
CONTAINER_EXISTS="docker images -q"
CONTAINER_RUN_ARGS=" --env PODMANOPT=no --env PODMANGROUPS=no"
elif ! command -v docker &> /dev/null; then
CONTAINER_TYPE="podman"
if [ -z "$(podman -v 2>&1 | grep -i 'not found')" ] && [ -z $(echo ${RESOLVE_CONTAINER_ENGINE} | grep -v -i podman) ]; then
CONTAINER_ENGINE="podman"
CONTAINER_BUILD="buildah bud"
CONTAINER_EXISTS="podman image exists"
CONTAINER_RUN_ARGS=" --annotation run.oci.keep_original_groups=1 --userns=keep-id"
elif [ -z "$(docker -v 2>&1 | grep -i 'not found')" ] && [ -n "$(docker -v 2>&1 | grep -i 'version')" ] && [ -z $(echo ${RESOLVE_CONTAINER_ENGINE} | grep -v -i docker) ]; then
CONTAINER_ENGINE="docker"
CONTAINER_BUILD="docker build ."
CONTAINER_EXISTS="docker images -q"
CONTAINER_RUN_ARGS=" --env PODMANOPT=no --env PODMANGROUPS=no"
else
echo "You must install either podman or docker and try again."
exit 1
Expand Down
4 changes: 2 additions & 2 deletions resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ if [ -z "${XAUTHORITY}" ]; then
echo "\$XAUTHORITY was not set. Defaulting to ${XAUTHORITY}"
fi

"${CONTAINER_TYPE}" run -it \
"${CONTAINER_ENGINE}" run -it \
--user resolve:resolve \
--env DISPLAY=$DISPLAY \
--env PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
Expand All @@ -204,8 +204,8 @@ fi
--device /dev/nvidia-modeset \
--device /dev/nvidia-uvm \
--device /dev/nvidia-uvm-tools \
--device /dev/bus/usb \
--mount type=bind,source=${XDG_RUNTIME_DIR}/pipewire-0,target=${XDG_RUNTIME_DIR}/pipewire-0 \
--mount type=bind,source=/dev/bus/usb,target=/dev/bus/usb \
--mount type=bind,source=$XAUTHORITY,target=/tmp/.host_Xauthority,readonly \
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
--mount type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix \
Expand Down

0 comments on commit 58e19e5

Please sign in to comment.