---
# System prepended metadata

title: Docker Installation
tags: [Docker]

---

# Docker Installation
###### tags: `Docker`
[TOC]

# How to Install Docker?
Whether you want **Docker for Mac/Windows/Linux** go to Docker's website and get to **Get Docker**.

![](https://i.imgur.com/4galR5p.png)

Or you can also just click below link to get there.
**Docker's website "Get Docker" Tab:** https://docs.docker.com/get-docker/

## Window's Docker Installation
After Selecting **Docker Desktop for Windows** you will see the image below and by following the buttons in the image, you will get to download a **Docker Desktop Installer** and by double clicking it, you will start the installation.
![](https://i.imgur.com/i71gFHp.png)


## Windows Installation Error

### Error: "Docker Installation process can't complete due to file being in use elsewhere"

> **Solution:** [color=lightblue]
>1. Open Task Manager
>1. Select tab Details
>1. Click to the title of the table. Click mouse right to open context menu. Select select columns
>1. Select to show the command line column
>1. Search the process occupied that file
>1. Kill the process It's okay with me.
![](https://i.imgur.com/3TpRXQu.png)

>**Reference:** [color=lightgreen]
https://stackoverflow.com/questions/53464007/docker-installation-process-cant-complete-due-to-file-being-in-use-elsewhere

### Error: "WSL 2 is not installed"
>WSL(Windows Sybsystem for Linux) is not installed as title states and it asks you to use **PowerShell** to execute the command **"Enable..."**.[color=red]
>
>**Note:** To use WSL2 your computer needs to support Hyper-V.
>**Note:** PowerShell is a program already provided in Windows.
>
>![](https://i.imgur.com/rAe8gBY.png)

#### What is PowerShell and how it differs from CMD?
>According to the reference below, **CMD is the original shell for the Microsoft DOS operating system**. 
While **Windows PowerShell is the new Microsoft shell** that combines the old CMD functionality with a new scripting/cmdlet instruction set with built-in system administration functionality. [color=orange]
>
>![](https://i.imgur.com/K3KTV1F.png)
>
>**Reference:** https://www.varonis.com/blog/powershell-vs-cmd/

#### Check Hyper-V Support
>Your computer also needs to support Hyper-V Virtualization to run WSL 2. You can check your Hyper-V support by clicking **Use Hyper-V**. After clicking, the following window will show up.[color=lightblue]
>
>![](https://i.imgur.com/hrjiTq2.png) 


### Error: "WSL2 installation in incomplete"
It tells you that you need to install **kernel update** by using the link provided.
>![](https://i.imgur.com/04Ji1Zs.png)[color=red]

By clicking the Link provided, it will redirect you to the next website, as shown in image below. You will need to get the **update kit** from lastest package and execute it when it is done downloading.
>![](https://i.imgur.com/9ARaoNO.png)[color=red]

As the image shown above, you will need to set WSL2 as default version to work. To set up, **open PowerShell** and execute **wsl --set-default-version 2**
>![](https://i.imgur.com/99WYypa.png)[color=red]

## Mac's Docker Installation
### Download Docker.dmg
Download url: https://www.docker.com/get-started

![](https://i.imgur.com/2Ocgo7k.png)


By clicking **Docker Desktop** you will download a file called **Docker.dmg**. By executing it, you will open the package and run it up.

![](https://i.imgur.com/tLi9nvO.png)

### Install Docker Application
![](https://i.imgur.com/fVJGb6g.png)

### Mac: "Get Started with Docker"
![](https://i.imgur.com/Qk7v2Cp.png)

#### Clone
![](https://i.imgur.com/IsWqHi0.png)

#### Build
![](https://i.imgur.com/Lwdt1z1.png)

#### Run
![](https://i.imgur.com/DpqXEX0.png)

#### Share
![](https://i.imgur.com/ja4WRai.png)


## Ubuntu's Docker Installation
>-Pending-
https://blog.gtwang.org/virtualization/ubuntu-linux-install-docker-tutorial/

# Was Installation successful?
## What do we see when installed succesfully?

### 1. Docker Program showing "Get Started"
![](https://i.imgur.com/Ohn2ARI.png)

### 2. Whale Icon
When the whale icon in the status bar stays steady, Docker Desktop is up-and-running, and is accessible from any terminal window.

![](https://i.imgur.com/WKXvh7I.png)



## CMD Check
Open CMD(Windows Command Prompt) and run:
* **docker version** to check the version.
* **docker run hello-world** to verify that Docker can pull and run images.

>Command: **docker version** [color=orange]
![](https://i.imgur.com/LcCYRTr.png)

>Command: **docker run hello-world** [color=orange]
![](https://i.imgur.com/8Tcyo0M.png)

# Docker Setting
By right clicking on Docker's Icon, you will be able to open its setting.
![](https://i.imgur.com/MtLVmRu.png)

# Docker General Tab
![](https://i.imgur.com/xyBziHf.png)



## How to use Hyper-V?
If you do not want to use WSL2 and want to use **Hyper V** instead, you can remove the click from **Use the WSL2 2 base engine**. After that, just restart your computer.

**Note:** To use Hyper V, your windows need to be **windows professional**. 
To check whether you are or not, go to windows > Setting > Sytem > About

>**WARNING:** [color=red]
You may encounter error if the Hyper-V was not used before, therefore, it will ask you to enable it on your computer.

**How to enable Hyper-V?**
1. Open PowerShell (**run as ADMINISTRATOR**)
1. Run command **Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All**

**Enable Containers Feature**:
Open PowerShell (**run as ADMINISTRATOR**) and run command below.
```=
Enable-WindowsOptionalFeature -Online -FeatureName containers –All
```

# Docker Resources Tab
Resource tab may or not have **Advanced** Tab, depending whether you are using **Hyper-V** or **WSL2**

>**The Advanced tab is only available in Hyper-V mode**, because in WSL 2 mode and Windows container mode these resources are managed by Windows. In WSL 2 mode, you can configure limits on the memory, CPU, and swap size allocated to the WSL 2 utility VM. [color=orange]


## **Hyper-V Type Resource Tab**
![](https://i.imgur.com/NX10u34.png)


## **WSL2 Type Resource Tab**
![](https://i.imgur.com/4LxLxhk.png)

# Docker Tools & Building Blocks
## Docker Engine
**Docker Engine** is installed when installing Docker Desktop/Tools or even when installing in linux.

## Daemon
**Daemon** is present in Docker Desktop which keeps running and ensures Docker works. This one contains a **Command Line Interface**, which is used to:
1. Run commands
1. Create Images & Containers


## Service Docker Hub
Allows to host our images in the cloud && web to share our systems with other people.

## Docker Compose
A Tool that is build up on Docker, which helps to manage more complex containers or multi-container easier.

## Kubernates
Kubernates can manage complex containerized applications that we want to deploy.
