Skip to content

Commit bfbb68c

Browse files
committed
✨ .zshrc for dev user and root user
1 parent 43187cb commit bfbb68c

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

build/base/assets/shell/zshrc-dev

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Lines configured by zsh-newuser-install
2+
HISTFILE=~/.histfile
3+
HISTSIZE=1000
4+
SAVEHIST=1000
5+
# End of lines configured by zsh-newuser-install
6+
# The following lines were added by compinstall
7+
zstyle :compinstall filename '/home/nonroot/.zshrc'
8+
9+
autoload -Uz compinit
10+
compinit
11+
# End of lines added by compinstall
12+
13+
CLICOLOR=1
14+
15+
# Working directory only (displaying `dev` user is sorta confusing and unnecessary)
16+
PROMPT="%F{cyan}%~%f > "
17+
18+
# Display contents of container as colored text list when shell first loads
19+
source $HOME/.welcome
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ compinit
1212

1313
CLICOLOR=1
1414

15+
# User (helpful to highlight that we're root) + working directory
1516
PROMPT="%F{blue}%n%f | %F{cyan}%~%f > "
16-
17-
source $HOME/.welcome

build/base/templates/Dockerfile.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ RUN set -ex \
101101
&& chown dev:nonroot /home/dev \
102102
&& chmod -R ug+rwx /home/dev \
103103
# Copy simple Z shell config file & give new user permissions
104-
&& cp /assets/base/shell/zshrc /home/dev/.zshrc \
104+
&& cp /assets/base/shell/zshrc-dev /home/dev/.zshrc \
105105
&& chown dev:nonroot /home/dev/.zshrc \
106106
# Copy welcome file & give new user permissions
107107
&& cp /assets/<%= @variant_dir -%>/shell/welcome /home/dev/.welcome \
108108
&& chown dev:nonroot /home/dev/.welcome \
109+
# Copy simple Z shell config file for root user (for running container as `-u root`)
110+
&& cp /assets/base/shell/zshrc-root /root/.zshrc \
109111
# Cleanup assets
110112
&& rm -rf /assets
111113

0 commit comments

Comments
 (0)