Skip to content

Logical05/zsh-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot from 2024-12-30 12-43-30 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.

Contents

Requirement

Usage

Docker image link

  • Getting this docker image

    docker pull logical05/zshtemplate
  • Run this docker image

    docker run -it logical05/zshtemplate
  • Reconnect to container

    1. List all the containers and find your container
      docker ps -a
    2. Start the exited container
      docker start <container ID>
    3. Attach to your container
      docker attach <container ID>
  • 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 ADD is not working correctly, you can use git clone instead
      ARG 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 TIMEZONE value to your local time zone
      ARG 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/*

Post-Installation Actions

  1. Reload the Tmux environment by pressing Ctrl-s + Shift-i while in Tmux.
  2. Install the Neovim plugins by pressing : and typing PlugInstall while in Neovim.

Configuration

This image comes with default configurations for Zsh, Tmux, and Neovim. You can customize these configurations by:

  • Zsh

    Edit ~/.zshrc for Zsh settings.

    • Alias

      New Old Description
      vi nvim Shorten the name
      ls exa --icons -h -g lists files and directories with icons, human-readable file sizes, and detailed file information (including permissions, ownership, and timestamps) in a grouped format
      l exa --icons -la -h -g Same as exa --icons -h -g but includes hidden ones
      ll exa --icons -ll -h -g Same as exa --icons -h -g but in a long listing style
    • Oh My Zsh

      • Edit plugins in ~/.zshrc.
      • Used Powerlevel10k theme. To customize prompt, run p10k configure or edit ~/.p10k.zsh.
  • Tmux

    Edit ~/.tmux.conf for Tmux settings.

  • Neovim

    Edit ~/.config/nvim/init.vim for Neovim settings.

    • Key Bindings

      • Edit key bindings in ~/.config/nvim/maps.vim.
    • Vim-Plug

      • Edit plugins in ~/.config/nvim/plug.vim.
    • Color Scheme

      • Edit color scheme in ~/.config/nvim/colors.
      • Used NeoSolarized.

Contributing

Feel free to open issues or pull requests to improve this image. Contributions are welcome!

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Docker image with Zsh, Oh My Zsh, Tmux, Neovim and plugins

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors