Docker Installation and Configuration
Check System Requirements
Ensure your system meets the following requirements:
Windows 10 64-bit: Pro, Enterprise, or Education (Build 15063 or later)
Enable Hyper-V and Containers Windows features
Download and Install Docker Desktop
Visit Docker Desktop for Windows and download the installer.
Run
Docker Desktop Installer.exe
to start the installation process.
Installation Steps
Double-click the
Docker Desktop Installer.exe
to launch the installer.When prompted, authorize the installer to proceed.
Follow the on-screen instructions to complete the installation.
When the installation is complete, Docker Desktop will prompt you to enable Hyper-V and Containers features if they are not already enabled. Click OK to enable these features, and then restart your computer if prompted.
Configure Docker
After your computer restarts, open Docker Desktop from the Start menu.
In Docker Desktop, click on the gear icon (Settings) in the top-right corner.
Go to the General tab and ensure
Use the WSL 2 based engine
is checked.Apply and restart Docker Desktop if necessary.
Verify Installation
Open Command Prompt or PowerShell.
Run the command:
docker --version
This command should display the installed Docker version.
Run a test container:
docker run hello-world
This command will download and run the
hello-world
container, displaying a confirmation message.
For more details, visit the Docker Desktop for Windows documentation.
Check System Requirements
Ensure your system meets the following requirements:
macOS 10.15 or newer
Download and Install Docker Desktop
Visit Docker Desktop for Mac and download the installer appropriate for your Mac (Intel or Apple Silicon).
Double-click the
Docker.dmg
file to open the installer.
Installation Steps
Drag the Docker icon to the Applications folder.
Open Docker Desktop from the Applications folder.
Docker Desktop will prompt you for permissions and to enter your password to install its components. Authorize and provide your password when prompted.
Configure Docker
Once Docker Desktop is running, click on the Docker icon in the top status bar and select Preferences.
Adjust settings in tabs such as General, Resources (CPU, Memory, Disk), and File Sharing based on your needs.
Verify Installation
Open Terminal.
Run the command:
docker --version
This command should display the installed Docker version.
Run a test container:
docker run hello-world
This command will download and run the
hello-world
container, displaying a confirmation message.
For more details, visit the Docker Desktop for Mac documentation.
Uninstall Old Versions
If you have older versions of Docker installed, remove them:
sudo apt-get remove docker docker-engine docker.io containerd runc
Set Up the Docker Repository
Update the
apt
package index:sudo apt-get update
Install packages to allow
apt
to use a repository over HTTPS:sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Set up the stable repository:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install Docker Engine
Update the
apt
package index again:sudo apt-get update
Install the latest version of Docker Engine, Docker CLI, and containerd:
sudo apt-get install docker-ce docker-ce-cli containerd.io
Start and Enable Docker
Start Docker:
sudo systemctl start docker
Enable Docker to start at boot:
sudo systemctl enable docker
Verify Installation
Run the command:
sudo docker --version
This command should display the installed Docker version.
Run a test container:
sudo docker run hello-world
This command will download and run the
hello-world
container, displaying a confirmation message.
Optional: Manage Docker as a Non-Root User
Create the
docker
group if it does not exist:sudo groupadd docker
Add your user to the
docker
group:sudo usermod -aG docker $USER
Log out and log back in so that your group membership is re-evaluated.
For more details, visit the Docker Engine installation documentation for Linux.