Last active
June 2, 2022 13:43
-
-
Save aburaihan-dev/5ebc0c65c71572bdf07738a5e30caee1 to your computer and use it in GitHub Desktop.
View Docker container restart policy
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
# Topic: Is it possible to show the restart policy of a running Docker container | |
# Reference: | |
https://stackoverflow.com/questions/43108227/is-it-possible-to-show-the-restart-policy-of-a-running-docker-container | |
# Solution: | |
docker ps|grep -v CON|awk '{print $1}'|while read line; do docker inspect -f "{{ .HostConfig.RestartPolicy.Name }}" $line |xargs echo $line ;done |
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
# K8s stop Docker container for JVB pods only | |
docker ps|grep jvb|awk '{print $1}'|while read line; do docker stop $line |xargs echo $line ;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment