INSTALLING DOCKER DESKTOP
Docker desktop is a packaged product from Docker, Inc. It runs on 64 bit versions of Windows 10 and MAC.
Once the docker desktop is installed, you have a single engine docker environment. It comes with docker compose and one can enable a single-node Kubernetes cluster.
Docker desktop on Windows can run both Windows and Linux containers. MAC supports only Linux containers.
Pre-requisites for Docker desktop on Windows:
- 64 bit processor
- 4 GB RAM.
- Hardware Virtualization must be enabled on BIOS.
- To enable hyper-V & Containers feauture on the OS level.
- WSL latest version.
For more information and installation refer: https://docs.docker.com/desktop/install/windows-install/
Once the installation is complete, you have to manually start Docker Desktop from the Windows start menu.
Docker installs 2 major components:
- Docker client
- Docker daemon/engine
The client talks to the daemon via a local IPC(Interprocess Communication) aka ‘Unix socket’. This runs at /var/run/docker.sock. Run the ‘docker version’ command to test and verify that the client and daemon(server) are talking to each other. If you get a response from the client and server, it means the installation is healthy.
Once Docker Desktop is up and running:
The output uner server component shows:
OS/Arch: linux/amd64
This is because by default Docker Desktop is set to work with Linux Containers. In this case the Docker daemon is running inside lightweight Linux Hyper-V VM.
To switch to Windows containers, right click on the Docker whale in the notification tray and choose Switch to Windows Containers.
If you get “Hyper-V” not enabled error, run the below command from elevated Powershell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
This will require a reboot.
Even after the switch to Windows Containers, any Linux Containers already running will peek running in the background. You won’t be able to manage those until switch back to Linux Container mode.
After the switch to Windows Container mode, below is the Docker version output:
Now you can run and manage Windows containers.
Docker Desktop for MAC
Docker Desktop for MAC is similar to Docker desktop for Windows. It is a packaged for MAC and gives you a single engine installation of Docker. This also allows to enable single-node Kubernetes cluster. But unlike Docker desktop for Windows, Docker desktop for MAC only allows Linux based Docker containers.
Find instructions for installing Docker desktop on MAC at the below link:
https://docs.docker.com/desktop/install/mac-install/
Once installed, launch Docker desktop from the launchpad. From a terminal windows run “docker version
“
Here the server component will show as linux/amd64. This is because the Docker daemon is running inside a Linux VM.
Docker Desktop for LINUX
Installing Docker on LINUX is as easy as Windows or MAC. You might want to think which LINUX distros to go for installing Docker. Most preferred and most talked distros when it comes to docker is the Ubuntu. And since, you will get better support for issues when docker is on an Ubuntu. But for a change lets go for centos.
I have a centos 7.
First we run an update on centos.
Run “yum check-update
” to check for any updates for your installed packages. It returns with a list of all package updates from all repositories if any are available.
Then to update, run “yum update
“.
To update a single package to the latest available version, run yum update <package name>
. For example ‘yum update httpd
‘ to update httpd package.
Make sure the centos-extras repository is enabled. This is enabled by default.
Check if you have older versions of docker installed.
To check, run command yum list installed | grep docker
. To uninstall, use “sudo yum remove <package name>
“. Images, containers, volumes, and networks are stored in “/var/lib/docker/
“. These are not automatically removed when you uninstall Docker. Following directories need to be manually removed:
“/var/lib/docker
“
“/var/lib/containerd
“
“/etc/docker
“
Run:
sudo rm -r /var/lib/docker
sudo rm -r /var/lib/containerd
sudo rm -r /etc/docker
Install yum-utils and add Docker repo.
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Install Docker Engine, containerd, and Docker Compose:
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
To Start docker:
sudo systemctl start docker