Skip to main content

Docker-Compose SMB/CIFS mounts

Overview

Mounting a remote Windows share is possible with Docker, but requires a little more configuration.

  PUID=$(id -u)
PGID=$(id -g)

# CONFIG_DIR - Where you settings are saved
CONFIG_DIR=/config

# CACHE_DIR - A tmpfs or and folder for temporary conversion files
CACHE_DIR=/tmp/unmanic

# CIFS Mount params
REMOTE_IP=192.168.0.20
PATH_TO_LIBRARY=/library
USERNAME=user
PASSWORD=password

# First create the docker volume mounting the CIFS remote share
docker volume create \
--driver local \
--opt type=cifs \
--opt device=//${REMOTE_IP}${PATH_TO_LIBRARY} \
--opt o=username=${USERNAME},password=${PASSWORD},vers=3.0,uid=${PUID},gid=${PGID} \
--name cifs_mount

# Now create the docker container using the created CIFS volume
docker run -ti --rm \
-e PUID=${PUID} \
-e PGID=${PGID} \
-p 8888:8888 \
-v ${CONFIG_DIR}:/config \
-v cifs_mount:/library \
-v ${CACHE_DIR}:/tmp/unmanic \
josh5/unmanic:latest