Added docker directory and scripts for resetting Docker

This commit is contained in:
Jason Hsu
2020-09-23 12:46:08 -05:00
parent a2610279d9
commit 06d54a3f4d
3 changed files with 46 additions and 0 deletions

3
docker/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Docker Scripts
Use the scripts in this directory to execute tasks in Docker. Please note that these scripts are intended to be executed from this app's root directory.

24
docker/nuke Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# This script destroys all Docker containers and images.
# SOURCE: https://gist.github.com/JeffBelback/5687bb02f3618965ca8f
docker/nukec
echo '--------------------------------------'
echo 'Killing and removing all Docker images'
for i in $(docker images -a -q)
do
docker kill $i; wait;
docker rmi -f $i; wait;
done;
echo '------------'
echo 'docker ps -a'
docker ps -a
echo '----------------'
echo 'docker images -a'
docker images -a
wait

19
docker/nukec Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# This script destroys all Docker containers and networks but leaves the Docker images alone.
echo '-----------------------'
echo 'docker network prune -f'
docker network prune -f
echo '------------------------------------------'
echo 'Killing and removing all Docker containers'
for i in $(docker ps -a -q)
do
docker kill $i; wait;
docker rm -f $i; wait;
done;
echo '------------'
echo 'docker ps -a'
docker ps -a