例如:
'alias 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
RUN echo "alias python=..." >> ~/.bash_profile
吧? https://dev59.com/4VoV5IYBdhLWcg3wVNea#36388856 - Roy Shilkrotalias alias
。 - Roy Shilkrot对我而言,在.bashrc文件中可行。
我把这个放在了Dockerfile里:
RUN echo "alias ll='ls -alF'" >> ~/.bashrc