The Dockerfile in this directory builds an image with ZSH installed for use in Web Terminal.
The image uses Oh My Zsh to enhance ZSH with themes and plugins. It includes the zsh-autosuggestions plugin as an example for installing ZSH plugins. You can learn more about Oh My Zsh here.
The $SHELL
environment variable determines the default shell in your Web Terminal. You can configure this in one of two ways:
- From within the Web Terminal Tooling image (as configured in this directory's
Dockerfile
). - By running the command
wtoctl set shell <shell-name>
.
To switch to ZSH using wtoctl
, run:
wtoctl set shell <shell-name>
Upon running the above command, your web terminal will restart and you will be presented with ZSH.
You can customize ZSH by mounting your .zshrc
into the Web Terminal using an automount configmap.
This repository provides the configmap-creator.sh
script, which allows for easily creating an automount configmap that is populated with the data of your choosing, such as a .zshrc
or any other configuration files. See here for instructions on how to use it.
If you'd like to manually create an automount configmap for your .zshrc
, ensure the following:
- The configmap exists in the same namespace as your web terminal.
- The configmap contains the following labels and annotations:
labels:
controller.devfile.io/mount-to-devworkspace: 'true'
controller.devfile.io/watch-configmap: 'true'
annotations:
controller.devfile.io/mount-as: subpath
controller.devfile.io/mount-path: <path>
Replace <path>
with the desired file path of your .zshrc
.
See here for an example of an automount configmap that mounts a .zshrc
.
The Web Terminal Tooling image includes a default ZSH configuration that provides:
- Autocompletion for default tools such as oc, tkn, kn and more.
- A helpful terminal startup message
- As well as other defaults.
To make use of the default Web Terminal ZSH configuration, ensure your .zshrc
begins with the following line:
source /tmp/initial_config/.zshrc
For an example of a custom .zshrc
configuration, check here
#TODO: !
Configure the following environment variables to point to your username in your container registry:
export REGISTRY=<your container registry>
export USER=<your registry's username>
With podman:
podman build . -t "${REGISTRY}"/${USER}/wto-tooling:zsh
podman push "${REGISTRY}"/${USER}/wto-tooling:zsh
With docker:
docker build . -t "${REGISTRY}"/${USER}/wto-tooling:zsh
docker push "${REGISTRY}"/${USER}/wto-tooling:zsh
export REGISTRY="quay.io"
export USER="aobuchow"
podman build . -t "${REGISTRY}"/${USER}/wto-tooling:zsh
podman push "${REGISTRY}"/${USER}/wto-tooling:zsh