Skip to content
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
24 changes: 24 additions & 0 deletions bind_mounts.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# DaVinci Resolve Bind Mounts Configuration
#
# Define which host folders will be accessible inside the Resolve container.
#
# USAGE:
# 1. Set TARGET to the desired mount point inside the container.
# 2. List absolute or home (~) paths below it.
# 3. Uncomment and edit as needed.

# Default mount point (do not change)
TARGET=/opt/resolve/Media

# === ADD YOUR MEDIA FOLDERS BELOW ===
#/home/user/Videos


# === CUSTOM MOUNT POINTS ===
# To mount elsewhere, define a new TARGET:
#TARGET=/mnt/CustomFolder
#/mnt/ExternalDrive/Project

# After adding new paths:
# - Restart the container
# - In Resolve: Preferences > Media Storage > Add
49 changes: 48 additions & 1 deletion env-set.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,54 @@ else
echo "The container's bind-mounts path (RESOLVE_MOUNTS_PATH) was manually set to : ${RESOLVE_MOUNTS_PATH}"
fi

# Read custom bind mounts from configuration file
if [ -f "${BASH_SOURCE%/*}/bind_mounts.conf" ]; then
echo "Reading bind mounts from bind_mounts.conf..."
while IFS= read -r source || [ -n "$source" ]; do
# Skip empty lines
[ -z "$source" ] && continue

# Skip comment lines (lines starting with #)
[ "${source:0:1}" = "#" ] && continue

# Check if the line defines a TARGET
if [[ "$source" =~ ^TARGET=.* ]]; then
TARGET="${source#TARGET=}"
echo "Setting target path within container to: $TARGET"
continue
fi

# Trim whitespace from source path
source="${source#"${source%%[![:space:]]*}"}"
source="${source%"${source##*[![:space:]]}"}"

# Replace ~ with the home directory
source="${source//\~/$HOME}"

if [ ! -e "$source" ]; then
echo "Warning: Bind mount source path does not exist: $source"
continue
fi

if [ ! -r "$source" ]; then
echo "Warning: Bind mount source path is not readable: $source"
continue
fi

# Create a sanitized target name from the source path's basename
target_name=$(basename "$source" | tr ' ' '_')

if [ -z "$TARGET" ]; then
TARGET="/opt/resolve/Media"
fi

target="${TARGET}/${target_name}"
RESOLVE_BIND_SOURCES+=("$source")
RESOLVE_BIND_TARGETS+=("$target")
echo "Added bind mount: $source -> $target"
done <"${BASH_SOURCE%/*}/bind_mounts.conf"
fi

# and notify if other tags were overridden

if [ ! -z ${RESOLVE_TAG} ]; then
Expand All @@ -50,4 +98,3 @@ fi
if [ ! -z ${RESOLVE_ZIP} ]; then
echo "The Resolve zip file location (RESOLVE_ZIP) was manually set to : ${RESOLVE_ZIP}"
fi