In this blog, you will learn,
- Prerequisite to install docker
- How to install docker on Ubuntu
- How to install docker on windows
In our previous blog, you may have understood the docker and its use as containers. So, the question is how do we do that? To understand this we must first have the docker-engine installed on our system. Let’s see how to install it.
Prerequisite for docker installation
To install docker we have some prerequisites which we must fulfill before starting to install docker. Make sure your system fulfills these prerequisites:
- You must have a 64-bit installation
- Version equal to 3.10 or higher of Linux kernel. It’s recommended to have the latest version.
iptables
version 1.4 or highergit
version 1.7 or higher- A
ps
executable, usually provided byprocps
or a similar package. - XZ Utils 4.9 or higher
- A properly mounted
cgroupfs
hierarchy; a single, all-encompassingcgroup
mount point is not sufficient. See Github issues #2683, #3485, #4568).
How to install docker on Ubuntu
To install docker on ubuntu you need to follow two steps:
- Setup Repository for Docker Hub
- Install Docker-Engine
Setup Repository for Docker Hub
Step 1: Run the given command to update
$ sudo apt-get update
Step 2: Now install the certifications
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
Step 3: Now setup the official GPG key with the given command,
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Step 4: Now verify the official GPG key with this command,
$ sudo apt-key fingerprint 0EBFCD88
With these steps you have successfully setup the repository to docker hub. Now let’s install the docker-engine.
Step 1: To install docker-engine on your system run the given commands
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
With these commands finally your docker is installed on your system. Now verify it with the given command,
$ docker version
If you get the output something like this, that means docker in installed successfully on your Ubuntu system. Now let’s do it for windows as well.
Also check this link for more clarification,
How to install docker on windows
To install docker on windows, the way of doing it is a bit different. Here, you don’t have to run it through commands instead you have to download docker desktop or docker toolbox. So if you want to download a docker desktop for your system then on your system you must have Windows 10 Professional/Enterprise/Home. If you have any of these windows on your system then you can use docker desktop and download it from here. If you are not using any of it or you are using the previous version then you have to download the docker toolbox from here. Use the stable version for it because sometimes the latest version is not compatible.
Once you have downloaded the docker as per your requirement. Now double click on the setup you just downloaded and it will start downloading and installing the packages that needs to to downloaded from the server.
While installing it will ask you to enable hyper-v. You have to select it and then press continue. Then it will start unpacking the packages and once it is done your installation will be done successfully.
Once the installation is done. Start the docker desktop as an administrator. Now the docker will start and will be minimized in the tray below. Let the docker icon gets stable, once the docker icon is stable that means the docker is running and you can now verify its installation in the command prompt with the given command,
docker version
If you get the results like this, that means the docker is installed successfully on your windows system.
Now lets create our first docker container with the given command,
docker run -it hello-world
This is what you should get in the output after you run this command,
Also check this link for more clarification,
This is all about the docker installation, I hope you have gained some good quality of knowledge from here. If you have any query then feel free to leave your query below in the comment section.
Stay tuned and Happy Learning. 🙂
One thought on “EASY WAY 2 INSTALL DOCKER?”