tmux
我正在尝试在 docker 容器内运行。它运行但会丢失变量PATH
,例如在容器内:
root@sparkmaster:/opt/bitnami/spark# ls /opt/bitnami/python/bin/python
/opt/bitnami/python/bin/python
root@sparkmaster:/opt/bitnami/spark# which python
/opt/bitnami/python/bin/python
root@sparkmaster:/opt/bitnami/spark# echo $PATH
/opt/bitnami/python/bin:/opt/bitnami/java/bin:/opt/bitnami/spark/bin:/opt/bitnami/spark/sbin:/opt/bitnami/common/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
然后在tmux
容器内:
root@sparkmaster:/opt/bitnami/spark# ls /opt/bitnami/python/bin/python
/opt/bitnami/python/bin/python
root@sparkmaster:/opt/bitnami/spark# which python
root@sparkmaster:/opt/bitnami/spark# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
即某些路径不存在,例如 Python 路径,但不是所有路径。
为什么以及如何解决?