SMB Sharing violation even though I have live folder interaction

This has probably been covered before but I’m facing an odd SMB permissions issue with a Docker duplicati instance.

All runs and can see everything, so Docker/duplicati can see the shares and the mounts etc - which after reading lots is the first major hurdle.

I can even get live updates from both sides. For instance - I create a new folder in the Windows share and then via Docker files tab I can see this and then even delete from the Docker side. So this confirms I have bi-directional control.

But as soon as I try and back up I get the dreaded ‘Sharing violation’.

image

image

The docker-compose.yml:

name: duplicati

services:
  duplicati:
    image: ghcr.io/linuxserver/duplicati:latest
    container_name: duplicati_server
    environment:
      - PUID=911
      - PGID=911
      - TZ=Europe/London
    ports:
      - "8200:8200"
    volumes:
      - ./volumes/config:/config
      - backup_temp:/temp
      - ./scripts:/scripts:ro
      - local_source:/data/source
      - /mnt/destination:/mnt/duplicati_destination
    restart: 'unless-stopped'
    privileged: true
    entrypoint: ["/bin/sh", "-c", "/scripts/mount_smb.sh && exec /init"]

volumes:
  local_source:
    driver: local
    driver_opts:
      o: bind
      type: none
      device: "D:/OneDrive"

  backup_temp:
    driver: local
    driver_opts:
      o: bind
      type: none
      device: "D:/backup_temp"

The mount_smb.sh

#!/bin/sh

# Create mount point if it does not exist
mkdir -p /mnt/duplicati_destination

# chown 911:911 /mnt
# chmod 777 /mnt

# chown 911:911 /mnt/duplicati_destination
# chmod 777 /mnt/duplicati_destination

# Mount the SMB share
mount -t cifs //10.0.0.90/Duplicati /mnt/duplicati_destination -o username=windowsUsername,password=windowsPassword,vers=3.0,uid=911,gid=911,file_mode=0777,dir_mode=0777

# Ensure the script exits successfully
exit 0