I am using a Ubuntu image (Ubuntu 20.04). Essentially, I am trying to modify my PATH permanently so that every time I start the container I don't have to manually edit the PATH to find the new items I have installed. However, no matter what I do I am unable to make the change permanent. I have sunk some considerable time into the image, so I would very much like to find a solution so I don't have to rebuild the whole thing.
Here is the shell information
#ps -p $$
PID TTY TIME CMD
9 pts/1 00:00:00 sh
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# PATH=$PATH:/kraken
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/kraken
#. ~/.profile
Now when I restart the container:
#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Basically, the PATH was not saved. I have been through so many blogs and stack and I can't find anything that sticks. Any help would be really appreciated.
Copyright Notice:Content Author:「DJFast」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/65673632/docker-ubuntu-path-wont-save