docker - 如何在 Docker 镜像的 .bashrc 中设置别名

标签 docker dockerfile

例如:
'别名 python=/home/user/python3.6'
我可能想放入我的 bashrc 中
我如何在 Dockerfile 中设置它
我知道设置路径变量的 ENV 命令,是否可以为设置别名做类似的事情?

最佳答案

只需使用 RUN 将别名添加到 bash_profile .

FROM ubuntu
MAINTAINER Mojtaba Yeganeh

RUN echo "alias python=/home/user/python3.6" >> ~/.bash_profile

关于docker - 如何在 Docker 镜像的 .bashrc 中设置别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48230825/

相关文章:

docker - HyperLedger Fabric v1.4.4:在mychannel上实例化智能合约,但出现错误

go - 我们可以在Dockerfile中用--no-cache连接多个RUN指令吗

docker - 单个 Docker 容器中的 Flask 和 React App

docker - 使用 Docker 和 Docker Compose 时, Cypress 无法验证此服务器是否正在运行

docker - 使用/healthz 进行应用程序健康检查的约定从何而来?

c++ - 使用 VSTS 构建 Linux C++

docker - 无法在jenkins docker镜像中添加jenkins-job-builder

python - 带有 ENV 变量和可选参数的 Docker ENTRYPOINT

ubuntu - Kubernetes 在本地开始使用 docker

docker - 在 Dockerfile 中以 --privileged 身份运行命令