This guide provides step-by-step instructions to install Docker on a Windows system.
Ensure your system meets the following requirements:
- Windows 10 64-bit: Pro, Enterprise, or Education (Build 15063 or later) or Windows 11
- Enable the WSL 2 feature on Windows. Docker Desktop requires the Windows Subsystem for Linux 2 (WSL 2) to run.
-
Check if Git is installed: Open PowerShell and type:
git --version
If Git is installed, you will see the version number. If not, proceed to the next step.
-
Download Git for Windows: Go to the Git for Windows page and click "Download".
-
Run the Installer: Run the downloaded installer and follow the instructions in the setup wizard. You can use the default settings for most options.
-
Verify the Installation: Open PowerShell and run:
git --version
You should see the Git version number if the installation was successful.
-
Go to the GitHub repository: Open your web browser and navigate to the repository URL.
-
Fork the repository: Click the "Fork" button on the top-right corner of the page. This will create a copy of the repository in your GitHub account.
-
Clone the forked repository: Open Terminal and run the following command, replacing
<your-username>
with your GitHub username:git clone [email protected]:<your-username>/ROS_Software_Assignement.git
Navigate to the cloned repository:
cd ROS_Software_Assignement
-
Enable WSL 1:
- Open PowerShell as an Administrator and run the following command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Open PowerShell as an Administrator and run the following command:
-
Enable Virtual Machine Platform:
- Run the following command in PowerShell:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Run the following command in PowerShell:
-
Set WSL 2 as the Default Version:
- Run the following command in PowerShell:
wsl --set-default-version 2
- Run the following command in PowerShell:
-
Install a Linux Distribution:
- Go to the Microsoft Store, search for "Linux" or "Ubuntu", and install your preferred Linux distribution.
Note
If you have troubles with the installation, check the Docker Installation page for Windows.
-
Download Docker Desktop:
- Go to the Docker Desktop for Windows page and click "Download for Windows".
-
Run the Installer:
- Run the downloaded installer. Follow the installation instructions, and make sure to enable the WSL 2 feature in the configuration step.
-
Run the Installer:
- Double-click
Docker Desktop Installer.exe
to run the installer. If you haven’t already downloaded the installer (Docker Desktop Installer.exe), you can get it from Docker Hub.
- Double-click
-
Follow the Installation Wizard:
- Follow the instructions on the installation wizard screens. When prompted, ensure the option to use WSL 2 is selected.
-
Start Docker Desktop:
- Once the installation is complete, start Docker Desktop from the Start menu.
-
Complete the Setup:
- Follow the guided onboarding to complete the setup.
-
Open PowerShell or Command Prompt:
- Open PowerShell or Command Prompt as an Administrator.
-
Run the Test Command:
- Verify that Docker is installed correctly by running the following command:
docker --version
- Verify that Docker is installed correctly by running the following command:
-
Run a Test Container:
- Run a test Docker container to ensure everything is set up correctly:
docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message.
- Run a test Docker container to ensure everything is set up correctly:
-
Set WSL 2 Integration:
- Open Docker Desktop, go to "Settings" -> "Resources" -> "WSL Integration". Ensure your installed WSL 2 distributions are enabled for integration with Docker.
-
Access Docker from WSL 2:
- Open your WSL 2 terminal (e.g., Ubuntu) and run Docker commands directly.
If you encounter any issues during the installation, here are some common troubleshooting steps:
- Ensure that the Docker Desktop service is running.
- Restart your computer to ensure all changes take effect.
- Check Docker logs for errors: Open Docker Desktop and go to "Troubleshoot" -> "Get Support" to view logs.
- Ensure WSL 2 is installed correctly and set as the default version.