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
  • 301
  • 3
  • 13

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
  • 675
  • 1
  • 10
  • 13
Mojtaba Yeganeh
  • 2,688
  • 1
  • 29
  • 46
1

For me it worked in .bashrc file.

I've put this in Dockerfile:

RUN echo "alias ll='ls -alF'" >> ~/.bashrc
Iasmini Gomes
  • 605
  • 1
  • 8
  • 12