Skip to content

Commit

Permalink
Ensure ~/.bashrc and ~/.bash_profile exist when persistUserHome enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
  • Loading branch information
AObuchow committed Nov 13, 2023
1 parent dbc7d1a commit aabe226
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions devspaces-udi/Dockerfile
Expand Up @@ -173,6 +173,10 @@ RUN \
mkdir -p /opt && \
# add user and configure it
useradd -u 1000 -G wheel,root -d /home/user --shell /bin/bash -m user && \
# Bash-related files are backed up to /home/tooling/ incase they are deleted when persistUserHome is enabled.
cp /home/user/.bashrc /home/tooling/.bashrc && \
cp /home/user/.bash_profile /home/tooling/.bash_profile && \
chown 10001 /home/tooling/.bashrc /home/tooling/.bash_profile && \
# $PROFILE_EXT contains all additions made to the bash environment
touch ${PROFILE_EXT} && chown 10001 ${PROFILE_EXT} && \
# Setup $PS1 for a consistent and reasonable prompt
Expand Down
5 changes: 5 additions & 0 deletions devspaces-udi/etc/.stow-local-ignore
@@ -1,2 +1,7 @@
# .viminfo cannot be a symlink for security reasons
\.viminfo

# We store bash related files in /home/tooling/ so they aren't overriden if persistUserHome is enabled
# but we don't want them to be symbolic links (or to cause stow conflicts). They will be copied to /home/user/ manually.
\.bashrc
\.bash_profile

0 comments on commit aabe226

Please sign in to comment.