Sample Header Ad - 728x90

How do I autosource path and venvs in /bin/sh (posix sh) for docker pods

3 votes
2 answers
130 views
I have a minimalistic pod that holds a small python program. I've added the source to $HOME/.profile but it does not autorun. How can I autosource it when I log in?
docker run -ti  / /bin/sh
# rc --v
/bin/sh: 2: rc: not found

#  tail -1 ~/.profile
. /venvs/base/bin/activate

# . ~/.profile
(base) # rc --v
20250701161141.660|INFO|/venvs/base/lib/python3.13/site-packages/rc/rc-info.py:73|version=0.18.3, build time: 2025-05-04 15:03:46.064232
I added /venvs/base/bin to /etc/environment, but its not there after docker run login:
# echo $PATH                         
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# cat /etc/environment
PATH="/venvs/base/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Asked by MortenB (401 rep)
Jul 1, 2025, 03:07 PM
Last activity: Jul 2, 2025, 10:52 AM