Docker is the new thing for the Linux community and it is probably the most trending right now. As it allows users to instantly run a piece of software or code without it interacting with the operating system itself. It is a very nice thing to have and is really a great piece of software. Using docker ,you can run those software which you otherwise might not be able to.
So What is Actually Docker ?
The name docker has been taken from “dock” which means a container. So docker actually provides users with independent containers where they can run software and those containers are portable meaning the containers can be used anywhere else as well. So, for example a container of Kali Linux made in Docker can be run across various other Linux distributions without worrying about the dependencies and conflicts issues as normal Linux users do. Also, the same container can be run on across virtual machines, clusters and clouds etc. This provides a ton on benefits as because the container itself has all the dependencies installed in it and it will not conflict with the operating system that is installed in your machine.
Features of Docker :
The following things can be easily accomplished by using Docker :
- You can create a sandbox where many different commands can be executed.
- You can create a service that will be fully isolated.
There are many other things that can be done with docker as it depends on the developer itself that what he wants to do with his or her software.
Now coming to the main topic and it is :
What are the advantages of Running Docker on Bash vs other shells?
Well, you might not know but by default Docker uses the bash shell. So if you execute a command in terminal, it will mean that it is actually executing the command in a bash shell and that means that all the commands will be executed using the standard shell of the most Linux Operating System, i.e bash shell. Otherwise, you can specify a different shell and run it on that shell or you can switch to a shell before and the run the docker using that shell.
In my opinion, it is better to run Docker using the bash shell because it is easily understandable and some applications that you run in docker might actually give better support of the bash shell as compared to other shells because the bash shell is widely used.
Docker by default uses the CMD [“/bin/bash”] in the Ubuntu Docker file configuration setting and that means that it executes command using the bash shell. You can change it to /bin/zsh or /bin/fish to use the zsh or fish shell respectively. But that depends on your choice and what you want to do.
The benefits of using Docker on Bash is just that it will be easy to use, at least in my opinion because some programs support the bash shell more as compared to other shells and usually provide better support for the bash shells.
When you type in the command docker run so it is going to use the default shell and if you want to run it in the zsh shell so you have to write docker /bin/zsh so it is then going to use the zsh shell rather than the fish shell.
So, that’s it. I hope you are going to like this and some of your confusions will be cleared that whether using docker in ubuntu on bash is better than using other shells or not.