Updating PATH environment variable permanently in Docker container

扶醉桌前 提交于 2019-11-28 17:44:25

If you want to include a /new/path in the Dockerfile, adding the line:

ENV PATH "$PATH:/new/path"

in Dockerfile should work.

Put in your Dockerfile a line ENV PATH xxx see an example in this Dockerfile https://gist.github.com/deepak/5933685

user859375

I got the answer for this question in irc chat. Given here for the benefit of anyone who may come across this. Many people have given wrong answers as update the ~/.profile but that did not work. So use the answer below.

Update the file ~/.bashrc for user or update the file /etc/enviroment global for global change which will apply for all users.

In .bashrc export PATH: export PATH=$PATH:/new/path/bin

In enviroment: PATH=$PATH:/new/path/bin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!