Created
September 27, 2025 11:22
-
-
Save donny-son/51270951ea3b86f0ccd746f37388b287 to your computer and use it in GitHub Desktop.
Temporarily save running docker containers and rerun them based on container ID list
This file contains hidden or 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
| # running container IDs into a txt list | |
| docker ps -q > running_containers.txt | |
| # stop containers based on container ID txt list | |
| for id in $(cat running_containers.txt); do docker stop $id; done | |
| # rerun containers based on container ID txt list | |
| for id in $(cat running_containers.txt); do docker start $id; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment