summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-08-10 15:09:35 -0500
committerToby Vincent <tobyv13@gmail.com>2021-08-10 15:09:35 -0500
commit0dfbb1f3298fa0c07b1eba42988baed04f4d41e3 (patch)
treec9a0d0bef8556d957ef60539a6f5e91a080880e3
parentf64962ee01f23b2edfa33baa751f3126aef7472e (diff)
fix: fixed docker machine wsl setup
-rw-r--r--shell/aliases.sh7
-rw-r--r--shell/wsl.sh11
2 files changed, 13 insertions, 5 deletions
diff --git a/shell/aliases.sh b/shell/aliases.sh
index 77cb68f..94b3543 100644
--- a/shell/aliases.sh
+++ b/shell/aliases.sh
@@ -19,8 +19,7 @@ alias cht="cht.sh"
alias dexec="docker exec -it"
alias dps="docker ps"
# docker compose
-alias dc="docker-compose"
-docker compose >&/dev/null && alias dc="docker compose"
+alias dc="docker compose"
alias dce="dc exec"
alias dcps="dc ps"
alias dcls="dc ls"
@@ -33,5 +32,5 @@ alias dclf="dc logs -f"
alias dm="docker-machine"
alias dma="docker-machine active"
alias dmi="docker-machine inspect"
-alias dmu="docker-machine-using"
-docker-machine-using() { eval $(docker-machine env ${1:=-u}); }
+alias dmu="docker-machine-use"
+docker-machine-use() { eval $(docker-machine env ${1:=-u}); }
diff --git a/shell/wsl.sh b/shell/wsl.sh
index 5c7b983..991adbc 100644
--- a/shell/wsl.sh
+++ b/shell/wsl.sh
@@ -12,10 +12,19 @@ export XDG_TEMPLATES_DIR="$WINHOME/Templates"
export XDG_VIDEOS_DIR="$WINHOME/Videos"
export EDITOR="code --wait"
+export DOCKER_HOST=${DOCKER_HOST:-tcp://0.0.0.0:2375}
+export DOCKER_MACHINE_NAME=${DOCKER_MACHINE_NAME:-$HOST}
alias cb=clip.exe
alias wsl=wsl.exe
alias ykman='/mnt/c/Program\ Files/Yubico/YubiKey\ Manager/ykman.exe'
+alias dmu="docker-machine-wsl"
+
+function docker-machine-wsl() {
+ docker-machine-use
+ export DOCKER_HOST=${DOCKER_HOST:-tcp://0.0.0.0:2375}
+ export DOCKER_MACHINE_NAME=${DOCKER_MACHINE_NAME:-$HOST}
+}
function wt() {
powershell.exe -NoProfile -c "wt $@"
@@ -44,4 +53,4 @@ function winget() {
}
# https://github.com/validatedev/drop-cache-if-idle
-[ -z "$(ps -ef | grep cron | grep -v grep)" ] && sudo /etc/init.d/cron start &> /dev/null \ No newline at end of file
+[ -z "$(ps -ef | grep cron | grep -v grep)" ] && sudo /etc/init.d/cron start &>/dev/null