orbstack / orbstack

Fast, light, simple Docker containers & Linux machines for macOS
https://orbstack.dev
MIT License
4.48k stars 31 forks source link

Add OrbStack to PATH in non-interactive shell #1155

Open dqbd opened 1 month ago

dqbd commented 1 month ago

When trying to connect to a remote OrbStack instance using Docker Context feature, the following error occurs.

# Using host=ssh://[host]:/Users/[username]/.orbstack/run/docker.sock

zsh:1: command not found: docker

This is due to initialisation script not being run when running a non-interactive shell. This can be remedied by adding the following line in ~/.zshenv

# Same as in .zprofile
source "$HOME/.orbstack/shell/init.zsh" 2>/dev/null || :