Last active
September 5, 2024 03:21
-
-
Save arctic-hen7/bbfcc3021f7592d2013ee70470fee60b to your computer and use it in GitHub Desktop.
ZSH configuration for nice Docker shells in Alpine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: for this to do anything, use my starter Dockerfile config (https://gist.github.com/arctic-hen7/10987790b86360820e2790650e289f0b) | |
# This file contains ZSH configuration for your shell when you interact with a container | |
# (we wouldn't want any boring `sh` now would we?) | |
# Please feel free to set up your own ZSH config in here! | |
# It gets mapped to your `.zshrc` for the root user in the container | |
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# Source Antigen | |
source ~/.antigen/antigen.zsh | |
autoload -U colors && colors | |
setopt promptsubst | |
# Set up oh-my-zsh | |
antigen use oh-my-zsh | |
# Set up plugins | |
antigen bundle git | |
antigen bundle docker | |
# Set up our preferred theme | |
antigen theme cloud | |
# Run all that config | |
antigen apply | |
# Set up Ctrl + Backspace and Ctrl + Del so you can move around and backspace faster (try it!) | |
bindkey '^H' backward-kill-word | |
bindkey -M emacs '^[[3;5~' kill-word | |
# Set up aliases | |
alias cl="clear" | |
alias x="exit" |
I am so confused with this.
- Why is this a .sh file? It looks like just a plain .zshrc file.
- How does
COPY <src> <dst>
access this file and copy it to the container path? How does it have access??
It is a .zshrc
file, just one that you'd put inside the root of your project, which allows the Dockerfile
's COPY
instruction to access it. I've just labelled it a .sh
file for uniformity, you could easily call it something else.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this starter Dockerfile to install ZSH and set everything up for you, using this config.