baseimage-docker:WhatIsTheWayToSetPATH-env-var?

54 views
Skip to first unread message

rdx...@gmail.com

unread,
Nov 29, 2017, 6:19:25 AM11/29/17
to passenger-docker
Hi, I just want to set a PATH var to add a path - so I can use it within the container, e.g. via 'docker exec'

What is the baseimage-way to do that?

Adding within a compose-file does not work, adding via

echo '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ANOTHER/DIR' > /etc/container_environment/PATH

in Dockerfile also does not take effect.

Check within the container:

# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


# cat /etc/container_environment/PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


Ho to fix this?

Giles Ellis

unread,
Jul 9, 2018, 11:47:26 AM7/9/18
to passenger-docker
This question was submitted ages ago.  I'm sure the OP has long since found his answer, but there's no answer posted here.  So I thought I'd add one, in case anyone else has the same question...

In the Dockerfile you can use the ENV command:

ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ANOTHER/DIR


Reply all
Reply to author
Forward
0 new messages