question

Sven-4995 avatar image
0 Votes"
Sven-4995 asked deherman-MSFT answered

Docker-compose: mount azure blob as volume

I am struggling to find the right information on how to mount blob storage as a volume in docker machine. I expect this is kind of basic, and I can mount the blob from the terminal, but as far as I know that is not how volumes are meant to be used from docker. How should I do this?

My docker-compose file looks something like:

 version: "3.9"
 services:
    
   test:
     build: .
     image: registry.gitlab.com/my_company/test
     command: test
     volumes:
       - blob:/mount/
       - /local_folder/:/local_folder
     network_mode: bridge
    
 volumes:
   blob:
     driver: ??
     driver_opts:
       share_name: my_blob
       storage_account_name: my_storage_account

I did find a related question on a File Share volume, but that is different then a blob storage I guess?




azure-blob-storageazure-container-instances
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Sven-4995 How are you mounting blob storage. Is this using NFS 3.0 for blob storage or blobfuse?


0 Votes 0 ·

@deherman-MSFT I have mounted it successfully to my local system using blobfuse. Is blobfuse also providing a docker volume driver? Or should I then take the NFS 3 route? I have found something about cloudstor but didn't manage to get it accepted as volume driver yet.

0 Votes 0 ·

1 Answer

deherman-MSFT avatar image
1 Vote"
deherman-MSFT answered

@Sven-4995 Blobfuse is not currently compatible with docker. You should be able to mount it with NFS 3.0 using the standard NFS options in docker.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@deherman-MSFT thanks, this seems to be the solution. I did have to create a new storage account with NFS3 explicitly enabled to get it to work.

"Fortunately" I had to do an operation on the data anyway, so in my case this is solved by combining the operation with a full copy to a new blob.

0 Votes 0 ·