about summary refs log tree commit diff
path: root/configs/shared/zsh/functions.zsh
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-04-02T20·29+0100
committerWilliam Carroll <wpcarro@gmail.com>2019-04-02T20·29+0100
commit8220336205226432c9fc3ca77f8f21c7af32f908 (patch)
tree30daae42e98ce4f3fd33494f0a3ad12c13611726 /configs/shared/zsh/functions.zsh
parentc88f3da4acc79bb4d570c0469d25263f96ed0925 (diff)
Support sandboxing languages like Elixir, Haskell
The previous commit foreshadows this change. This also introduces so changes for
the Docker tooling.
Diffstat (limited to 'configs/shared/zsh/functions.zsh')
-rw-r--r--configs/shared/zsh/functions.zsh18
1 files changed, 16 insertions, 2 deletions
diff --git a/configs/shared/zsh/functions.zsh b/configs/shared/zsh/functions.zsh
index 26f81a3ca656..645426cd9044 100644
--- a/configs/shared/zsh/functions.zsh
+++ b/configs/shared/zsh/functions.zsh
@@ -64,12 +64,26 @@ apts() {
 }
 
 # Docker
-dsh() {
+dkcsh() {
   # Drop into a Docker shell. Shell defaults to /bin/bash.
+  # `dkcsh` stands for DocKer Container SHell.
+  # Usage: dkcsh
   container=$1
   cmd=${2-/bin/bash}
 
-  docker exec -it "${container}" "${cmd}"
+  docker exec -it "$container" "$cmd"
+}
+
+dkish() {
+  # Runs a Docker container with `/usr/bin/env bash`.
+  # `dkish` stands for DocKer Image SHell.
+  # Note: This defers from `dksh`, which accepts a container instead of an
+  # image.
+  # Usage: dkrit <container_name> [command]
+  image=$1
+  cmd=${2-/bin/bash}
+
+  docker run -it "$image" "$cmd"
 }
 
 # Emacs