ll
is an alias(shorthand) for ls -alF
as specified in the same SO question that has been pointed out. In Linux, you can use the alias to shorten any command. The format of alias is alias_name='<full command>'
.
Some Linux releases come pre-loaded with a set of default aliases like alias rm='rm -i'
, mv='mv -i'
. ll
is one among them. If you are getting such error then you need to add alias ll='ls -alF'
.
Now the problem is where to add?
Everyone will suggest putting the alias in ~/.bashrc
. But this file will be read-only if you use the bash shell. Hence there is always a chance that it might be missed out. You need to put it in a place which will be always(most likely) be read.
I agree that most people will suggest you add it to /etc/profile
but here you are not supposed to make changes unless you know what you are doing. But you can put this kind of workarounds as a small shell script and put it under /etc/profile.d
with *.sh
extension as this directory is always read in almost all shells.
So the solution is you need to create a file with sh extension containing the alias and put it in /etc/profile.d/
.
Applying all these in your Dockerfile it can be rewritten as
FROM ubuntu
MAINTAINER my name <my email address>
RUN echo "alias ll='ls -alF'" > /etc/profile.d/alias.sh && apt-get update
CMD ["echo","Hello World...! from my first docker image"]
Note: It seems alpine images don't read /etc/profile.d by default hence follow this in case if you use it.