Brew install docker does not include docker engine?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Docker has become an indispensable tool for developers and IT professionals, enabling the deployment and management of applications in containerized environments. However, setting up Docker on macOS using Homebrew can lead to some confusion. Specifically, users may find that running brew install docker does not result in the installation of the Docker Engine. This article aims to clarify the reasons behind this and provide guidance on how to effectively use Docker on a macOS system.
Understanding Docker Components
Docker comprises several key components:
- Docker Engine: The core of Docker, responsible for creating and running containers.
- Docker CLI (Command Line Interface): Allows interaction with Docker Daemon through command-line instructions.
- Docker Daemon: A background service that manages Docker containers on a host system.
Homebrew and Docker Installation
Homebrew is a popular package manager for macOS that simplifies the installation of software. However, when you execute the command brew install docker, you are only installing the Docker CLI, not the Docker Engine or Daemon. Here is the reasoning behind this:
Key Points of brew install docker
| Component | Installed via brew install docker | Explanation |
| Docker CLI | Yes | Provides command-line tools to interact with Docker Daemon. |
| Docker Engine | No | Homebrew cannot natively install Docker Engine since it relies on Linux kernel features not available on macOS. |
| Docker Daemon | No | Similar to the engine, the Daemon needs a Linux-based environment. |
Technical Explanation
The Docker Engine and Daemon are designed to operate on Linux due to their reliance on Linux kernel features such as control groups and namespaces. macOS does not natively support these Linux features, which is why the full Docker Engine cannot be installed directly via Homebrew. Instead, macOS users typically rely on a Linux-based virtual machine to run Docker.
How to Run Docker on macOS
Despite these limitations, running Docker on macOS is feasible by following these steps:
Installing Docker Desktop for macOS
- Download Docker Desktop: This is the recommended way of running Docker on macOS. Docker Desktop includes Docker Engine and Daemon, operating in a Linux virtual environment through HyperKit, a lightweight macOS hypervisor.
- Installation Process:
- Download Docker Desktop from the official Docker website.
- Open the downloaded
.dmgfile. - Drag and drop Docker to the Applications folder.
- Starting Docker: Once installed, you can start Docker Desktop from the Applications folder. Docker Daemon will run within a LinuxKit VM.
Using Command Line Tools
With Docker Desktop running:
- Start Docker CLI: Open a terminal and ensure Docker commands are available using
docker --version. - Run Docker Commands: You can now run standard Docker commands like
docker run,docker build, anddocker ps.
Configuring Docker Components
Docker Desktop provides a GUI to manage and configure resources available to the Docker VM, such as CPU, memory, proxies, and network. This graphical interface simplifies container management and monitoring for macOS users.
Alternative: Running Docker with Multipass
For those seeking an alternative to Docker Desktop, using Multipass to create a Linux VM is an option:
- Install Multipass: Install using Homebrew with
brew install --cask multipass. - Create and Configure VM:
- Launch a Ubuntu VM with
multipass launch --name docker-vm. - Access the VM with
multipass shell docker-vm.
- Install Docker Inside the VM:
- Update package information:
sudo apt update. - Install Docker:
sudo apt install docker.io.
- Access Docker from Host:
- Use
multipass exec docker-vm -- docker commandto execute Docker commands directly from the host terminal.
Summary
To fully leverage Docker on macOS, reliance on Docker Desktop or creating a Linux VM is necessary. This stems from the Linux-specific technologies upon which Docker Engine and Daemon depend. Although brew install docker provides the CLI component, understanding how to run the complete Docker suite is essential for effective macOS development and operation.
Understanding and addressing potential limitations will empower you to choose the best Docker solution for your workflow, ensuring seamless development, deployment, and operation of containerized applications.

