Docker Community Forums

Share and learn in the Docker community.

Docker config as a distributed lock?

swarm
docker

(Jkuan) #1

Is it safe to use docker config as a way to acquire a distributed lock?

For example, on manager nodes, I might do this as part of a larger script:

set -e

echo “$HOSTNAME $$” | docker config create mylock -
trap ‘docker config rm mylock’ EXIT

Thanks