3

For example: 'alias python=/home/user/python3.6' Is something I might want to put into my bashrc How do I set this in a Dockerfile I know of the ENV command which sets path variable, is it possible to do similar for setting an alias?

SaltedPork
  • 345
  • 3
  • 16

2 Answers2

11

simply use RUN to add an alias to bash_profile.

FROM ubuntu
MAINTAINER Mojtaba Yeganeh

RUN echo "alias python=/home/user/python3.6" >> ~/.bash_profile
Bartleby
  • 1,144
  • 1
  • 13
  • 14
Mojtaba Yeganeh
  • 2,788
  • 1
  • 30
  • 49
1

For me it worked in .bashrc file.

I've put this in Dockerfile:

RUN echo "alias ll='ls -alF'" >> ~/.bashrc
Iasmini Gomes
  • 727
  • 1
  • 9
  • 14