0

I'm trying to mount an Azure File Share to my docker container. I found this blog that describes how to do this.

https://medium.com/srcecde/mount-azure-file-storage-as-volume-on-docker-container-in-virtual-m-fc77a9fc5506

My problem is that I'm keep getting the following notification when I'm trying to run docker compose up.

PS C:\git\AzureFileSharePOC> docker compose up
[+] Running 3/3
 - Network AzureFileSharePOC_default                    Created                         0.0s
 - Volume "AzureFileSharePOC_AzureFileShareVolume"      Created                         0.0s
 - Container AzureFileSharePOC-fileshare.poc-1          Created                         0.1s
Attaching to AzureFileSharePOC-fileshare.poc-1
Error response from daemon: error while mounting volume '/var/lib/docker/volumes/AzureFileSharePOC_AzureFileShareVolume/_data': failed to mount local volume: mount //xxx.file.core.windows.net/testshare:/var/lib/docker/volumes/AzureFileSharePOC_AzureFileShareVolume/_data, data: mfsymlinks,vers=3.0,username=xxx,password=yyy,addr=20.60.222.232: resource temporarily unavailable

Docker compose:

version: '3.4'

services:
  fileshare-poc:
    image: ${DOCKER_REGISTRY-}filesharepoc
    build:
      context: ./
      dockerfile: AzureFileShare.POC/Dockerfile
    env_file:
     - ./AzureFileShare.POC/azurefileshare.poc.env
    restart: always
    volumes:
      # /app is a folder
      - AzureFileShareVolume:/AzureFileShare

volumes:
  # mount the Azure file share volume
  AzureFileShareVolume:
    driver: local
    driver_opts:
      type: "cifs"
      o: "mfsymlinks,vers=3.0,username=${AzureFileShare_StorageAccountName},password=${AzureFileShare_Key},addr=${AzureFileShare_StorageAccountName}.file.core.windows.net"
      device: "//${AzureFileShare_StorageAccountName}.file.core.windows.net/${AzureFileShare_Container}"

azurefileshare.poc.env:

  • zzz = storage account name in azure
  • xxx = container name in azure
  • yyy = key in out of azure
# Azure File Share configuration
AzureFileShare_StorageAccountName=zzz
AzureFileShare_Container=xxx
AzureFileShare_Key=yyy
StuiterSlurf
  • 2,464
  • 4
  • 34
  • 55

0 Answers0