diff options
author | Robert Reed <robert.mc.reed@gmail.com> | 2021-08-22 17:22:30 -0700 |
---|---|---|
committer | Robert Reed <robert.mc.reed@gmail.com> | 2021-08-22 17:22:30 -0700 |
commit | e45f1cff76ae5b6000c4efd35d6dc759359c4b3f (patch) | |
tree | 4dcb410b5dd47bd20aeabd7b52ab4dee1c41e8b9 | |
parent | 0719f34f77f377647b3c975f01a8a7ae6ff88f59 (diff) |
feat: uninstall all docker artifacts
-rwxr-xr-x | dactyl.sh | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -9,8 +9,10 @@ set -e container="" shellContainer=DM-shell -configContainer=DM-config modelContainer=DM-model +configContainer=DM-config +containers=("$shellContainer" "$configContainer" "$modelContainer") + imageName=dactyl-keyboard srcBind="$(pwd)/src:/app/src" thingsBind="$(pwd)/things:/app/things" @@ -289,11 +291,15 @@ function handleRebuildImage() { buildImage } +function removeImage() { + inform "Removing docker image: $imageName..." + docker image rm $imageName +} + function handleRemoveImage() { warn "This will remove docker image: $imageName" confirmContinue "Would you like to continue?" - inform "Removing docker image: $imageName..." - docker image rm $imageName + removeImage } function handleInspectImage() { @@ -551,6 +557,20 @@ function promptStartShellSession() { } ################################ +# Uninstaller +################################ + +function handleUninstall() { + for currentContainer in "${containers[@]}"; do + container="$currentContainer" + removeContainer + done + + removeImage + exit +} + +################################ # Main Menu Logic ################################ |