Add configuration for Docker, and don't autostart

This commit is contained in:
Loic Nageleisen 2022-09-09 13:49:32 +02:00
parent 0ddb6ed242
commit 61c6b23bfb
Signed by: lloeki
GPG key ID: D05DAEE6889F94C2

View file

@ -1,4 +1,10 @@
if [[ "${OSTYPE}" == *darwin* ]]; then
if [[ -f "${HOME}"/.config/dotfiles/docker ]]; then
source "${HOME}"/.config/dotfiles/docker
export DOCKER_VM_IP="${ip}"
export DOCKER_VM_SSH="${user}@${DOCKER_VM_IP}"
export DOCKER_HOST="ssh://${DOCKER_VM_SSH}"
elif [[ "${OSTYPE}" == *darwin* ]]; then
for app in 'VMware Fusion.app' 'VMware Fusion Tech Preview.app'; do
if [[ -f "/Applications/${app}/Contents/Library/vmrun" ]]; then
vmrun="/Applications/${app}/Contents/Library/vmrun"
@ -16,15 +22,17 @@ if [[ "${OSTYPE}" == *darwin* ]]; then
unset vm
if [[ -n "${vmrun:-}" && -n "${vmx:-}" ]]; then
started=0
if "${vmrun}" list | grep -q "${vmx}"; then
# vm started
:
started=1
else
# TODO: user feedback facilities
echo "* Starting Docker VM"
"${vmrun}" start "${vmx}" nogui
#echo "* Starting Docker VM"
#"${vmrun}" start "${vmx}" nogui
echo "* Docker VM not found"
fi
if [[ "${started}" = 1 ]]; then
# TODO: use 'docker' once Gomeisa is gone
user='root'
@ -37,7 +45,9 @@ if [[ "${OSTYPE}" == *darwin* ]]; then
export DOCKER_VM_SSH="${user}@${DOCKER_VM_IP}"
export DOCKER_HOST="ssh://${DOCKER_VM_SSH}"
fi
fi
unset started
unset vmrun
unset vmx
unset ip