{"id":10816,"date":"2024-07-02T05:39:24","date_gmt":"2024-07-02T05:39:24","guid":{"rendered":"https:\/\/www.bacancytechnology.com\/qanda\/?p=10816"},"modified":"2024-10-22T06:31:55","modified_gmt":"2024-10-22T06:31:55","slug":"driver-options-for-docker-cloudstor-azure-plugin","status":"publish","type":"post","link":"https:\/\/www.bacancytechnology.com\/qanda\/cloud\/driver-options-for-docker-cloudstor-azure-plugin","title":{"rendered":"Driver Options for Docker Cloudstor Azure Plugin?"},"content":{"rendered":"<p>If the Docker volume\/logging driver is not installed on the cluster, you can install it manually by using the RDP\/SSH protocols.<br \/>\nAn example of the script to install the docker volume driver for azure.<\/p>\n<p><strong>Example : <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\">\r\ndocker plugin install --alias azure --grant-all-permissions docker4x\/cloudstor:17.09.0-ce-azure1  \\\r\n    CLOUD_PLATFORM=AZURE \\\r\n    AZURE_STORAGE_ACCOUNT=\"[MY-STORAGE-ACCOUNT-NAME]\" \\\r\n    AZURE_STORAGE_ACCOUNT_KEY=\"[MY-STORAGE-ACCOUNT-KEY]\" \\\r\n    DEBUG=1\r\n<\/pre>\n<p>you create a Docker service or container and specify a volume with the cloudstor:azure driver, you would define the options like this:<\/p>\n<p><strong>Example : <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\">\r\ndocker service create --name my-service --mount type=volume,volume-driver=cloudstor:azure,source=myvolume,target=\/data,\r\nvolume-opt=size=200GB,volume-opt=azureaccountname=myaccount,\r\nvolume-opt=azureaccountkey=mykey myimage\r\n<\/pre>\n<p>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&#8217;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.<\/p>\n<h3>1. Cloudstor Plugin Setup<\/h3>\n<p>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.<\/p>\n<p>However, this plugin is designed to create and manage Azure Files as volumes, so the volumes themselves would be stored on Azure.<\/p>\n<h3>2. External Storage Connection<\/h3>\n<p>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 <strong>Azure File Sync or AzCopy<\/strong> to synchronize your on-premises files with Azure Storage.<\/p>\n<h3>3. Custom Approach: Using NFS or SMB<\/h3>\n<p><strong>NFS or SMB:<\/strong> 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).<\/p>\n<p>Docker containers can then mount this NFS or SMB share as a volume.<br \/>\n<strong>Example : <\/strong> <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\">\r\nmount -t nfs 192.168.1.100:\/path\/to\/nfs \/mnt\/my-nfs\r\n<\/pre>\n<h3>4. Docker Volume with Custom Mount<\/h3>\n<p>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.<\/p>\n<p><strong>Example : <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\">\r\ndocker run -d  --name my-container -v \/mnt\/my-nfs:\/data my-image\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211;alias azure &#8211;grant-all-permissions docker4x\/cloudstor:17.09.0-ce-azure1 \\ CLOUD_PLATFORM=AZURE \\ AZURE_STORAGE_ACCOUNT=&#8221;[MY-STORAGE-ACCOUNT-NAME]&#8221; \\ AZURE_STORAGE_ACCOUNT_KEY=&#8221;[MY-STORAGE-ACCOUNT-KEY]&#8221; \\ DEBUG=1 you create a Docker [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10808,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-10816","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/10816"}],"collection":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/comments?post=10816"}],"version-history":[{"count":3,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/10816\/revisions"}],"predecessor-version":[{"id":11523,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/10816\/revisions\/11523"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media\/10808"}],"wp:attachment":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media?parent=10816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/categories?post=10816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/tags?post=10816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}