Docker version 17.06.0-ce
I'm studying Docker by watching a video course.
The lecturer shows:
sudo docker run -ti ubuntu /bin/bash
Run docker with image ubuntu. And what troubles me is /bin/bash\
.
man docker run
shows that /bin/bash
is a command.
That is docker run IMAGE [COMMAND]
.
Well, it is ok. But what is the difference between
sudo docker run -ti ubuntu
and
sudo docker run -ti ubuntu /bin/bash
For me there is none. And the lecturer doesn't focus attention on the command. He said that we are just run docker. It was his first command in the course. And then he shows that we have been isolated from the host machine, we can freely ruin what we want without any damage (like rm -rf /bin).
I checked:
$ sudo docker run -ti ubuntu
root@aaf7cd26fe18:/# echo $SHELL
/bin/bash
$ sudo docker run -ti ubuntu /bin/bash
root@6b2570958216:/# echo $SHELL
/bin/bash
Well, for myself I decided to throw this /bin/bash
part away as garbage.
But anyway I decided to ask you: maybe there is some difference between the two ways of running Docker? If there is, what it is like?