Installing Docker on Your Mac
1. Download Docker Desktop for Mac:
- Go to Docker Website
- Click on “Get Started”
2. Install Docker Desktop:
- Open the downloaded
.dmg
file. - Drag the Docker icon to the Applications folder to install it. - Open Docker from your Applications folder. - You may be prompted to enter your email, so follow the on-screen instructions.
3. Verify the Installation:
Open a terminal and type the following command to check if Docker is installed correctly:
docker --version
4. Run a Test Container:
To ensure Docker is functioning properly, run a simple container like “Hello World”:
docker run hello-world
This command will download a test image and run it, outputting a message that confirms Docker is installed and working.
If you run a Docker command like
docker run hello-world
for the first time and see a message saying, “Unable to find the image locally”, don’t worry! This just means the image isn’t on your machine yet.Docker will automatically start downloading the image from Docker Hub. Once the image is downloaded, it will run.