This is a Docker image that installs and configures Zsh, Oh My Zsh, Tmux, Neovim, and various essential plugins.
This image simplifies setting up a terminal environment that can be used for development in Docker containers.
- To use this Docker image, you need to install Docker.
- Meslo Nerd Font patched for Powerlevel10k.
-
Getting this docker image
docker pull logical05/zshtemplate
-
Run this docker image
docker run -it logical05/zshtemplate
-
Reconnect to container
- List all the containers and find your container
docker ps -a
- Start the exited container
docker start <container ID>
- Attach to your container
docker attach <container ID>
- List all the containers and find your container
-
Usage within your Dockerfile
# Add non-root user ARG USERNAME=user ARG USER_UID=1000 ARG USER_GID=$USER_UID RUN apt-get update && apt-get install -y sudo && \ rm -rf /var/lib/apt/lists/* && \ groupadd -g $USER_GID $USERNAME && \ useradd -m -u $USER_UID -g $USERNAME $USERNAME && \ echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \ chmod 0440 /etc/sudoers.d/$USERNAME # Use a non-root user USER $USERNAME WORKDIR /home/$USERNAME # Use the installation script ARG path=/tmp ADD --chown=$USERNAME:$USERNAME https://github.com/Logical05/zsh-template.git $path RUN sudo chmod +x $path/setup-zsh.sh && $path/setup-zsh.sh $path
- If the
ADDis not working correctly, you can usegit cloneinsteadARG path=/tmp/zsh-template RUN git clone --depth=1 https://github.com/Logical05/zsh-template.git $path - If your time is not set correctly, you can set it by adding these lines and changing the
TIMEZONEvalue to your local time zoneARG TIMEZONE=Asia/Bangkok RUN /bin/sh -c echo '$TIMEZONE' > /etc/timezone && \ ln -s /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \ apt-get update && apt-get install -y tzdata && \ rm -rf /var/lib/apt/lists/*
- If the
- Reload the Tmux environment by pressing
Ctrl-s+Shift-iwhile in Tmux. - Install the Neovim plugins by pressing
:and typingPlugInstallwhile in Neovim.
This image comes with default configurations for Zsh, Tmux, and Neovim. You can customize these configurations by:
-
Edit
~/.zshrcfor Zsh settings.-
New Old Description vinvimShorten the name lsexa --icons -h -glists files and directories with icons, human-readable file sizes, and detailed file information (including permissions, ownership, and timestamps) in a grouped format lexa --icons -la -h -gSame as exa --icons -h -gbut includes hidden onesllexa --icons -ll -h -gSame as exa --icons -h -gbut in a long listing style -
- Edit plugins in
~/.zshrc. - Used Powerlevel10k theme. To customize prompt, run
p10k configureor edit~/.p10k.zsh.
- Edit plugins in
-
-
Edit
~/.tmux.conffor Tmux settings.-
Key New Old prefixCtrl-sCtrl-b -
- Edit plugins in
~/.tmux.conf. - Used Tmux powerline theme theme.
- Edit plugins in
-
-
Edit
~/.config/nvim/init.vimfor Neovim settings.-
- Edit key bindings in
~/.config/nvim/maps.vim.
- Edit key bindings in
-
- Edit plugins in
~/.config/nvim/plug.vim.
- Edit plugins in
-
- Edit color scheme in
~/.config/nvim/colors. - Used NeoSolarized.
- Edit color scheme in
-
Feel free to open issues or pull requests to improve this image. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.