Skip to content

Instantly share code, notes, and snippets.

@lyluongthien
Created August 16, 2023 04:10
Show Gist options
  • Save lyluongthien/9fcc18e39f72bb849c8048ebfa72b18e to your computer and use it in GitHub Desktop.
Save lyluongthien/9fcc18e39f72bb849c8048ebfa72b18e to your computer and use it in GitHub Desktop.
Add Z Shell to any container
#!/bin/bash
# Add Z Shell to any container
## 1. Ensure your container has git
## 2. Ensure your container has openssh and wget
## (checking os is not necessarily, fails will be failed 😉)
apt-get install openssh-client wget # apline
apk --update add openssh-client wget # debian
brew install openssh-client wget # mac 😂
## 3. Install zsh-in-docker with configs
sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.5/zsh-in-docker.sh)" -- \
-t https://github.com/denysdovhan/spaceship-prompt \
-a 'SPACESHIP_PROMPT_SEPARATE_LINE="false"' \
-p git \
-p ssh-agent \
-p 'history-substring-search' \
-p https://github.com/zsh-users/zsh-autosuggestions \
-p https://github.com/zsh-users/zsh-completions
## Finally, run zsh:
zsh
## (Again, some OSs do not support the `source` command (like "source ~/.zshrc"),
## so we just run a new one to make things simple 😉)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment