Permission Issue with Mounting a SMB/CIFS Network Share to Docker Container Volume

Hello, I’m running into some permission issues with mounting a volume for a CIFS network share to a Docker container. Does anything below jump out as misconfigured? Or does this permission issue seem to be coming from the network share itself?

For awareness, I’m using Docker Desktop (v4.12.0) for Windows 10 Enterprise (10.0.19042 Build 19042), and my container consists of a RedHat Linux JBoss server. The container is created/configured from a docker-compose.yml file. I’ve tried to configure the volume using a docker-compose.yml file and by creating a volume manually using “docker volume create …” from a terminal, but both ways result in the same error.

The error I receive is:
PS D:\docker\JBoss> docker-compose up
[+] Running 3/3

  • Network jboss_default Created 0.0s
  • Volume “jboss_networkDriveVolume” Created 0.0s
  • Container jboss-jboss_development-1 Created 0.1s
    Attaching to jboss-jboss_development-1
    Error response from daemon: error while mounting volume ‘/var/lib/docker/volumes/jboss_networkDriveVolume/_data’: failed to mount local volume: mount //CIFS_DIR_PATH:/var/lib/docker/volumes/jboss_networkDriveVolume/_data, data: username=USERNAME_HERE,password=PASSWORD_HERE,addr=IP_HERE,nolock,soft,file_mode=0777,dir_mode=0777: permission denied

A simplified docker-compose.yml can be found below:

version: "3.4"

##########################################################################
# Mount SMB/CIFS drive for various file access                           #
##########################################################################
volumes:
  networkDriveVolume:
    driver: local
    driver_opts:
      type: cifs
      o: username=${USERNAME},password=${PASSWORD},rw,addr=IP_HERE,nolock,soft,file_mode=0777,dir_mode=0777
      device: "//IP_HERE/FTCCM/PROJECTS/wpg/temp"

services:
  jboss_development:
    hostname: ${HOST_NAME}
    dns:
      - DNS1_HERE
      - DNS2_HERE
    environment: 
      - HOSTNAME=${HOST_NAME}
      - PUID=101
      - PGID=201
      - DEBUG=true
      - DEBUG_PORT=*:8787

    image: IMAGE_HERE
    ports:
      - "19993:9993"
      - "18080:8080"
      - "18443:8443"
      - "8787:8787"

    volumes:
        
      ##########################################################################
      # Mount SMB/CIFS drive for various file access                           #
      ##########################################################################

      - type: volume
        source: networkDriveVolume
        target: /testDir

You might want to try adding the noperm option to your o: param.