Created
December 2, 2023 07:18
-
-
Save hacker-volodya/87ef2841876e88052759817970fd0fc4 to your computer and use it in GitHub Desktop.
Stop all docker containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in /var/lib/docker/containers/*/config.v2.json; do | |
touch "$i.new" && getfacl -p "$i" | setfacl --set-file=- "$i.new" | |
cat "$i" | jq -c '.State.Running = false' > "$i.new" && mv -f "$i.new" "$i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment