Skip to content

Instantly share code, notes, and snippets.

@residualmind
Last active July 24, 2020 11:22
Show Gist options
  • Save residualmind/d9dc9a9f32b1bfad19fc1c06ddaff131 to your computer and use it in GitHub Desktop.
Save residualmind/d9dc9a9f32b1bfad19fc1c06ddaff131 to your computer and use it in GitHub Desktop.
tmp_containers_running=$(mktemp) # make tempfile
echo $tmp_containers_running # print tempfile location
docker ps -q >$tmp_containers_running # save ids
# whatever you need to do, for instance:
sudo systemctl restart docker # restart docker
docker start $(<$tmp_containers_running) # restart containers from saved ids
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment