Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker devcontainer with oh-my-zsh and Powerlevel10k

I've been trying to make a devcontainer with zsh as my default terminal, I have done the initial configuration following the the feature add to the container enter image description here

after doing this how would I add the powerlevel10k to my dockerfile so that it would be automated whenever the container is built?

I also tried to follow the official documentation with automated install https://github.com/deluan/zsh-in-docker but can't seems to make powerlevel10k work

like image 933
tangir miah Avatar asked Jan 01 '26 20:01

tangir miah


1 Answers

So the way I got it to work was to host my specific powerlevel10k file on github and just downloading it during the Dockerfile creation and adding a line to the .zshrc to source the .p10k.zsh file like so:

# Install oh-my-zsh with customized theme
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.5/zsh-in-docker.sh)" -- \
    -p git
RUN echo '[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh' >> .zshrc
RUN wget https://raw.githubusercontent.com/chbroecker/dotfiles/main/zsh/.p10k.zsh -O .p10k.zsh
like image 116
chbroecker Avatar answered Jan 03 '26 12:01

chbroecker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!