Skip to content

Instantly share code, notes, and snippets.

@aburaihan-dev
Last active June 2, 2022 13:43
Show Gist options
  • Save aburaihan-dev/5ebc0c65c71572bdf07738a5e30caee1 to your computer and use it in GitHub Desktop.
Save aburaihan-dev/5ebc0c65c71572bdf07738a5e30caee1 to your computer and use it in GitHub Desktop.
View Docker container restart policy
# 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
# 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