If the Docker volume/logging driver is not installed on the cluster, you can install it manually by using the RDP/SSH protocols.
An example of the script to install the docker volume driver for azure.

Example :

docker plugin install --alias azure --grant-all-permissions docker4x/cloudstor:17.09.0-ce-azure1  \
    CLOUD_PLATFORM=AZURE \
    AZURE_STORAGE_ACCOUNT="[MY-STORAGE-ACCOUNT-NAME]" \
    AZURE_STORAGE_ACCOUNT_KEY="[MY-STORAGE-ACCOUNT-KEY]" \
    DEBUG=1

you create a Docker service or container and specify a volume with the cloudstor:azure driver, you would define the options like this:

Example :

docker service create --name my-service --mount type=volume,volume-driver=cloudstor:azure,source=myvolume,target=/data,
volume-opt=size=200GB,volume-opt=azureaccountname=myaccount,
volume-opt=azureaccountkey=mykey myimage

If you want to build a container with external storage that connects to Azure Storage but is not hosted on Azure, the Docker Cloudstor plugin can be a useful tool. However, it sounds like you’re aiming to connect an external storage volume (not hosted on Azure) to Azure Storage, which is slightly different from the typical use case for Cloudstor.

1. Cloudstor Plugin Setup

The cloudstor:azure plugin is typically used to create and manage Azure Files shares that are automatically mounted to Docker containers running in a Docker Swarm or on individual Docker hosts.

However, this plugin is designed to create and manage Azure Files as volumes, so the volumes themselves would be stored on Azure.

2. External Storage Connection

If your goal is to connect an external storage system (like an on-premises NAS or other cloud storage) to Azure, then you would generally use something like Azure File Sync or AzCopy to synchronize your on-premises files with Azure Storage.

3. Custom Approach: Using NFS or SMB

NFS or SMB: You can create an NFS or SMB server that serves as your external storage, and then connect that server to Azure Files using a synchronization tool (like Azure File Sync).

Docker containers can then mount this NFS or SMB share as a volume.
Example :

mount -t nfs 192.168.1.100:/path/to/nfs /mnt/my-nfs

4. Docker Volume with Custom Mount

You can manually mount your external storage to your Docker host (via NFS or SMB), and then mount that directory as a volume in your Docker container.

Example :

docker run -d  --name my-container -v /mnt/my-nfs:/data my-image

Support On Demand!

Cloud