如何在 Docker 映像的 .bashrc 中设置别名

Sal*_*ork 3 docker dockerfile

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

Moj*_*bye 10

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

FROM ubuntu
MAINTAINER Mojtaba Yeganeh

RUN echo "alias python=/home/user/python3.6" >> ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)