diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000000..c0eebe46c9 --- /dev/null +++ b/docker/README.md @@ -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. diff --git a/docker/nuke b/docker/nuke new file mode 100755 index 0000000000..65f0f7c2bc --- /dev/null +++ b/docker/nuke @@ -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 diff --git a/docker/nukec b/docker/nukec new file mode 100755 index 0000000000..c26472df79 --- /dev/null +++ b/docker/nukec @@ -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