SUMMARY: This article introduces Docker and reviews how to install Docker for Mac.

1. Downloading Docker for Mac

2. What to know before installing

3. Installing and running Docker for Mac

4. Getting started with Docker for Mac

 

Docker is an open-source tool designed to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.

Docker is a bit like a virtual machine, but rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they’re running on and only requires applications to be shipped with parts not already running on the host computer. This gives a significant performance boost and reduces the size of the application. 

Docker is basically a container engine that uses Linux kernel features like namespaces and control groups to create containers on top of an operating system and automates application deployment on the container.

 

Downloading Docker for Mac

You can download installers from the Stable or beta (Edge) channel. 

Both Stable and Edge installers come with experimental features in Docker Engine enabled by default and configurable on Docker Daemon preferences for experimental mode. 

The installation provides Docker Engine, CLI client, Docker Compose, Docker Machine and Kitematic.

Stable channel

This installer is fully baked and tested. This is the best channel to use if you want a reliable platform to work with. These stable Docker for Mac releases follow the Docker Engine stable releases. Stable builds are released once per quarter.

https://download.docker.com/mac/stable/Docker.dmg

Edge channel

This installer provides the latest Edge release of Docker for Mac and Engine and typically offers new features in development. Use this channel to get experimental features faster, and if you can weather some instability and bugs. 

Edge builds are released once per month.

https://download.docker.com/mac/edge/Docker.dmg

 

What to know before installing

Relationship to Docker Machine 

Installing Docker for Mac does not affect machines created with Docker Machine. We have the option to copy containers and images from the local default machine (if one exists) to the new Docker for Mac Hyperkit VM. When you are running Docker for Mac, you do not need Docker Machine nodes running at all locally (or anywhere else). With Docker for Mac, you have a new, native virtualization system running (HyperKit), which takes the place of the VirtualBox system.

System Requirements 

Docker for Mac launches only if all of these requirements are met:

1. Mac hardware must be a 2010 or newer model, with Intel’s hardware support for memory management unit (MMU) virtualization, including Extended Page Tables (EPT) and Unrestricted Mode. To check if your machine has this support invoke the following command in a terminal: 

# sysctl kern.hv_support

 

2. At least 4GB of RAM.

3. VirtualBox prior to version 4.3.30 must NOT be installed. (It is incompatible with Docker for Mac.) If you have a newer version of VirtualBox installed, it’s fine.

 

Installing and running Docker for Mac

1. Double-click Docker.dmg to open the installer, then drag the Docker whale icon to the Applications folder.

2. Double-click Docker.app in the Applications folder to start Docker.

3. You will be prompted to authorize Docker.app with your system password after you launch it. Privileged access is needed to install networking components and links to the Docker apps.

4. The whale in the top status bar indicates that Docker is running, and accessible from a terminal.

5. Click the whale to get Preferences and other options.

 

Getting started with Docker for Mac

1. Open a command-line terminal and execute the commands below to ensure versions of docker, docker-compose, and docker-machine are up-to-date and compatible with Docker.app. 

Laptop269pnin:~ poojarathod$ docker version

Client: Docker Engine - Community

 Version:           19.03.4

 API version:       1.40

 Go version:        go1.12.10

 Git commit:        9013bf5

 Built:             Thu Oct 17 23:44:48 2019

 OS/Arch:           darwin/amd64

 Experimental:      false

Server: Docker Engine - Community

 Engine:

  Version:          19.03.4

  API version:      1.40 (minimum version 1.12)

  Go version:       go1.12.10

  Git commit:       9013bf5

  Built:            Thu Oct 17 23:50:38 2019

  OS/Arch:          linux/amd64

  Experimental:     false

 containerd:

  Version:          v1.2.10

  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339

 runc:

  Version:          1.0.0-rc8+dev

  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657

 docker-init:

  Version:          0.18.0

  GitCommit:        fec3683



Laptop269pnin:~ poojarathod$ docker-compose version

docker-compose version 1.24.1, build 4667896b

docker-py version: 3.7.3

CPython version: 3.6.8

OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018



Laptop269pnin:~ poojarathod$ docker-machine version

docker-machine version 0.16.2, build bd45ab13

 

2. Test that your installation works by running the simple Docker image “hello-world”:

Laptop269pnin:~ poojarathod$ docker run hello-world

Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

1b930d010525: Pull complete 

Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f

Status: Downloaded newer image for hello-world:latest



Hello from Docker!

This message shows that your installation appears to be working correctly.

 

Docker is now up and running on your Mac!