summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Reed <robert.mc.reed@gmail.com>2021-08-22 17:22:30 -0700
committerRobert Reed <robert.mc.reed@gmail.com>2021-08-22 17:22:30 -0700
commite45f1cff76ae5b6000c4efd35d6dc759359c4b3f (patch)
tree4dcb410b5dd47bd20aeabd7b52ab4dee1c41e8b9
parent0719f34f77f377647b3c975f01a8a7ae6ff88f59 (diff)
feat: uninstall all docker artifacts
-rwxr-xr-xdactyl.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/dactyl.sh b/dactyl.sh
index bf6259c..c0bc41e 100755
--- a/dactyl.sh
+++ b/dactyl.sh
@@ -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
################################