Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gregjhogan/9054ca1626486fad826b12a0d02a9830 to your computer and use it in GitHub Desktop.
Save gregjhogan/9054ca1626486fad826b12a0d02a9830 to your computer and use it in GitHub Desktop.
docker cloudstor azure file share volume
# ONLY WORKS FROM INSIDE AZURE !!! (cloudstor can't mount CIFS v3 volumes - required when connecting over internet)
STORAGE_ACCOUNT=<account>
STORAGE_KEY=<key>
STORAGE_SHARE=<share>
# configure
docker plugin install --alias cloudstor:${STORAGE_ACCOUNT} --grant-all-permissions docker4x/cloudstor:18.06.1-ce-azure2 CLOUD_PLATFORM=AZURE AZURE_STORAGE_ACCOUNT_KEY="${STORAGE_KEY}" AZURE_STORAGE_ACCOUNT="${STORAGE_ACCOUNT}" AZURE_STORAGE_ENDPOINT="core.windows.net" DEBUG=1
# create
docker volume create --driver=cloudstor:${STORAGE_ACCOUNT} --opt=share=${STORAGE_SHARE} ${STORAGE_SHARE}
# test
docker run --rm -v ${STORAGE_SHARE}:/data --cap-add SYS_ADMIN --cap-add DAC_READ_SEARCH -it busybox
# remove
docker plugin rm cloudstor:${STORAGE_ACCOUNT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment