This commit is contained in:
parent
ce19d6a62c
commit
624ab42f73
26 changed files with 493 additions and 163 deletions
16
.local/bin/scripts/docker
Executable file
16
.local/bin/scripts/docker
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
declare -A CONTEXTS=(
|
||||
["cpu"]=hicpu
|
||||
["gpu"]=higpu
|
||||
)
|
||||
|
||||
WORKDIR="$(pwd)"
|
||||
[[ "$WORKDIR" = "$HOME/Services"* ]] && {
|
||||
_ctx="$(cut -d'/' -f1 <<<"${WORKDIR#"${HOME}/Services/"}")"
|
||||
[ -n "$_ctx" ] && _ctx="${CONTEXTS["$_ctx"]}" && \
|
||||
[ -n "$_ctx" ] && ctx="--context=$_ctx"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
/usr/bin/docker $ctx "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue