Skip to content

Instantly share code, notes, and snippets.

@jpralves
Created October 28, 2019 16:00
Show Gist options
  • Save jpralves/ddae2dd7f26c16ac6a74d06a28957a4c to your computer and use it in GitHub Desktop.
Save jpralves/ddae2dd7f26c16ac6a74d06a28957a4c to your computer and use it in GitHub Desktop.
Obtain list of docker swarm secrets used by each stack
for s in $(docker service ls --format "{{.Name}}"); do echo $s; docker service inspect $s --format '{{range .Spec.TaskTemplate.ContainerSpec.Secrets}}{{println " " .SecretName}}{{end}}'; done
@jpralves
Copy link
Author

The script should be run in a manager node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment