Skip to content

Instantly share code, notes, and snippets.

@christianacca
Created March 10, 2019 16:09
Show Gist options
  • Save christianacca/2679997d932a73f2bdb789e76d1efd79 to your computer and use it in GitHub Desktop.
Save christianacca/2679997d932a73f2bdb789e76d1efd79 to your computer and use it in GitHub Desktop.
configure docker node automatically
# this specific example configures a docker storage plugin automatically when a node joins the swarm
docker service create --mode global --restart-condition none \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--name enable-cloudstor-azure-plugin \
docker:latest \
sh -c "echo Set up and enable cloudstor:azure plugin. Be patient... && sleep 120 && docker plugin set cloudstor:azure AZURE_STORAGE_ACCOUNT_KEY=PUT-YOUR-AZURE-STORAGE-KEY-HERE && docker plugin enable cloudstor:azure && docker plugin ls && echo Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment