How to Install Dockers - Linux
These days, the words "dockers" and "kubernetes" are very common to hear if you work in IT. Many applications are preferred by devs to use dockers nowadays. I work with deployment of two distinct applications that need dockers to work. Those applications are Dell EMC PowerProtect Cyber Recovery and Cyber Sense. If you want to know more about these applications and what they do, you can take a look here.
So, naturally, I also became curious about what dockers are and what they do. So, I started reading up on them, watched some youtube videos, and now, I am midway thru a formal docker training at the end of which I hope I learn dockers and kubernetes properly.
So, I have installed CentOS, RHEL, OpenSUSE etc. VMs on virtualbox in my Ubuntu desktop. Then, I installed dockers on all these OSs. Installation of docker is pretty straightforward and is documented very well at dockers.com. Here is just my experience of the whole exercise of installing docker and docker-compose on CentOS 7.9 and CentOS stream 8.x VM. The process is largely the same with a very small difference as pointed out below. I will update this for OpenSUSE at a later date. As for debian based desktop OS, installation of docker on e.g. Ubuntu can be done simply using apt-get install as the docker installs are made a part of the official repositories, so that one is very VERY straightforward.
One more important thing to know is that docker comes in two flavors: Community Edition (CE) and Enterprise Edition (EE). Docker CE is completey free to use, while Docker EE requires a license and is most suitable for Enterprise OS's such as SUSE and RHEL, but this is not to say that only one edition is compatible with a given OS. Docker CE and Docker EE can be installed on any supported OS. Docker CE has all the features that Docker EE has, the difference is only that EE gets paid support which means a user can basically get official technical support for Docker from the vendor. I am, of course, going to use Docker CE for installation.
All right, here is what we will need to install Docker CE:
CPU - 4 vCPUs
RAM - 2GB
Disk - 22GB
lordvader@srvcent09 ~$ sudo yum install -y yum-utils
lordvader@srvcent09 ~$ sudo yum-config-manager?? --add-repo \? https://download.docker.com/linux/centos/docker-ce.repo
lordvader@srvcent09 ~$ sudo yum install docker-ce docker-ce-cli containerd.io
This is where CentOS 7.9 and CentOS Stream 8 will have a difference. Its a known issue as on June 2021 that the repo and docker version has conflicts. Workaround is to use --nobest and --allowerasing options in the command above while installing on CentOS 8 Stream
领英推荐
lordvader@srvcent09 ~$ sudo systemctl enable docker.service
lordvader@srvcent09 ~$ sudo systemctl enable containerd.service
lordvader@srvcent09 ~$ sudo docker run hello-world
Running docker ps will show the images currently running on this VM
Notice the overlay in the output of df -h. This is basically the storage driver that docker uses to cache the images locally. But this discussion is for another day.
At this point, docker installation is complete and basic docker images and containers can be used. However, there is another very popular tool which is recommended to be installed known as docker-compose that among other things, uses yaml files to deploy images instead of docker commands. Very useful tool. Install it by running the following command (double check the link as it will change with every new release:
lordvader@srvcent09 ~$ sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
lordvader@srvcent09 ~$ sudo chmod +x /usr/local/bin/docker-compose
So, there you have it folks, a fully functional docker enabled Linux VM ready for container deployments. I am deploying a simple web application that uses NodeJS and React on AWS, but that is for another day.
PS: Some bonus docker commands:
it - provide input
???used to run many similar apps and run??commands on a particular instance
Principal Consultant at Dell Technologies
3 年Thanks for taking time to share your learning ! Appreciated