Home

Awesome

Oh My Zsh Installer for Docker

Last Release Build Downloads

This is a script to automate Oh My Zsh installation in development containers. Works with any image based on Alpine, Ubuntu, Debian, Amazon Linux, CentOS 7, RockyLinux 8,9 and Fedora.

The original goal was to simplify setting up zsh and Oh My Zsh in a Docker image for use with VSCode's Remote Containers extension, but it can be used whenever you need a simple way to install Oh My Zsh and its plugins in a Docker image

Usage

One line installation: add the following line in your Dockerfile:

# Default powerline10k theme, no plugins installed
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)"

Optional arguments:

Examples:

# Uses "robbyrussell" theme (original Oh My Zsh theme), with no plugins
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
    -t robbyrussell
# Uses "git", "ssh-agent" and "history-substring-search" bundled plugins
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
    -p git -p ssh-agent -p 'history-substring-search' \
    -a 'bindkey "\$terminfo[kcuu1]" history-substring-search-up' \
    -a 'bindkey "\$terminfo[kcud1]" history-substring-search-down'

# Uses "Spaceship" theme with some customization. Uses some bundled plugins and installs some more from github
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
    -t https://github.com/denysdovhan/spaceship-prompt \
    -a 'SPACESHIP_PROMPT_ADD_NEWLINE="false"' \
    -a 'SPACESHIP_PROMPT_SEPARATE_LINE="false"' \
    -p git \
    -p ssh-agent \
    -p https://github.com/zsh-users/zsh-autosuggestions \
    -p https://github.com/zsh-users/zsh-completions

Notes

Liked it?

If you like this script, feel free to thank me with a coffee (or a beer :wink:):

ko-fi