As we have seen in the previous post, Docker is an open source platform for developing, shipping and running application which enables you to separate your applications from your infrastructure so that you can deliver software quickly.
Docker can be downloaded and installed on multiple platforms. You can find more information here.
There are two options available for installing Docker on Windows.
The first one is Docker on windows using Docker toolbox and the second one is the Docker desktop for Windows option. Please note you cannot have both solutions at the same time on the same windows host. There is a migration and guide available on Docker documentation page on how to migrate from virtual box to Hyper-V.
In this post, we will be discussing the steps for installing Docker Desktop for Windows.
1. Download Docker -
You can download docker here.
2. Ensure that the system on which you're going to install the docker meets the requirements -
WSL 2 backend
Windows 11 64-bit: Home or Pro version 21H2 or higher, or Enterprise or Education version 21H2 or higher.
Windows 10 64-bit: Home or Pro 21H1 (build 19043) or higher, or Enterprise or Education 20H2 (build 19042) or higher.
Enable the WSL 2 feature on Windows. For detailed instructions, refer to the Microsoft documentation.
The following hardware prerequisites are required to successfully run WSL 2 on Windows 10 or Windows 11:
1. 64-bit processor with Second Level Address Translation (SLAT)
2. 4GB system RAM
3. BIOS-level hardware virtualization support must be enabled in the BIOS settings. For more
information, see Virtualization.
Download and install the Linux kernel update package.
Containers and images created with Docker Desktop are shared between all user accounts on machines where it is installed. This is because all Windows accounts use the same VM to build and run containers. Note that it is not possible to share containers and images between user accounts when using the Docker Desktop WSL 2 backend.
Install Docker Desktop on Windows
There are 2 ways to install Docker on windows. Let's look at both the options in more details below -
1. Install interactively
Double-click Docker Desktop Installer.exe to run the installer.
When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not depending on your choice of backend. If your system only supports one of the two options, you will not be able to select which backend to use.
Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
When the installation is successful, click Close to complete the installation process.
If your admin account is different to your user account, you must add the user to the docker-users group. Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.
2. Install from the command line
After downloading Docker Desktop Installer.exe, run the following command in a terminal to install Docker Desktop-
"Docker Desktop Installer.exe" install
If you’re using PowerShell you should run it as -
Start-Process 'Docker Desktop Installer.exe' -Wait install
If using the Windows Command Prompt -
start /w "" "Docker Desktop Installer.exe" install
The install command accepts the following flags:
--quiet: suppresses information output when running the installer
--accept-license: accepts the Docker Subscription Service Agreement now, rather than requiring it to be accepted when the application is first run
--no-windows-containers: disables Windows containers integration
--allowed-org=<org name>: requires the user to sign in and be part of the specified Docker Hub organization when running the application
--backend=<backend name>: selects the default backend to use for Docker Desktop, hyper-v, windows or wsl-2 (default)
--installation-dir=<path>: changes the default installation location (C:\Program Files\Docker\Docker)
--admin-settings: Automatically creates an admin-settings.json file which is used by admins to control certain Docker Desktop settings on client machines within their organization. For more information, see Settings Management.
- It must be used together with the --allowed-org=<org name> flag.
- For example,
--allowed-org=<org name> --admin-settings='{"configurationFileVersion": 2, enhancedContainerIsolation": {"value": true, "locked": false}}'
If your admin account is different to your user account, you must add the user to the docker-users group:
net localgroup docker-users <user> /add
Start Docker Desktop
Docker Desktop does not start automatically after installation. To start Docker Desktop:
1. Search for Docker, and select Docker Desktop in the search results.
2. The Docker menu displays the Docker Subscription Service Agreement window.
3. Select Accept to continue. Docker Desktop starts after you accept the terms.
This concludes this post.
We will discuss more about Docker commands in the next blogs.
Thank you for reading !
*** Explore | Share | Grow ***
Comments