DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. An Introduction to Docker for Mac

An Introduction to Docker for Mac

Here's a look at the Docker beta for Mac, ranging from installation and setup to some simple test runs.

Chris Ward user avatar by
Chris Ward
CORE ·
Jul. 22, 16 · Opinion
Like (7)
Save
Tweet
Share
13.94K Views

Join the DZone community and get the full member experience.

Join For Free

Recently out of private beta, Docker's new native applications aim to replace the current methods for running Docker on Windows and Mac, creating a better experience for developers using those platforms.

For the previous solution, Docker Toolbox used VirtualBox to create a small Linux virtual machine that hosted your images and containers. It worked pretty well, but it could be unreliable at times and required workarounds that sometimes resulted in unexpected outcomes or didn't work at all.

Docker for Mac removes the dependency on VirtualBox and instead uses virtualization technology that is already part of Mac OS X, HyperVisor. Docker for Windows uses Microsoft's virtualization technology, Hyper-V. These changes aim to make your Docker containers run faster than before, take up less disk space, and fit better into your operating system.

I am a Mac user, so I'll be focusing on the Mac version of Docker's new application, but I'll highlight any significant differences with the Windows version.

Install and Setup

Download the native application for your platform here.

Successive updates to the application have made the installation process and the resulting application increasingly "more native" and better integrated with the operating system. Because the application uses newer technologies only available in newer machines and OS versions, it has minimum requirements, which are:

Mac Minimum Requirements

  • A 2010 or newer model, with Intel's hardware support for memory management unit (MMU) virtualization.
  • OS X 10.10.3 Yosemite or newer, as the HyperVisor framework used is available in Yosemite onward.
  • At least 4GB of RAM.
  • VirtualBox prior to version 4.3.30 must not be installed, as it will cause issues with Docker for Mac.

Windows minimum requirements

  • 64-bit Windows 10.

Co-Existing With Docker Toolbox

If you are using Docker Toolbox, your images and containers can typically coexist together. This is thanks to Docker Toolbox using VirtualBox to host images and containers and installing command line tools to more "Linux" path locations. Both Docker for Mac and Windows are fully native to the host platform and install everything into locations you would expect (e.g., the Applications folder), only using symlinks to make certain tools accessible on the command line.

docker_mac_package


When you first run the Docker application, it will check your system for compatibility and requirements, show a welcome screen, and then start the Docker process. Your main interaction with the Docker application will be via a menu bar item: To stop and start the Docker process, open Kitematic for GUI access to your containers, find documentation, and access preferences.

Preferences and Configuration

docker_mac_prefs


General

The General pane has settings for configuring the specs of the virtual machine, updates, and excluding the virtual machine from backups (Mac only). This is a simple but useful feature to have, as it can end up being a large file.

docker_mac_vm_file


Advanced

Many enterprise users of Docker use their own registries for custom images. The advanced settings pane lets you define custom registries to search for images that you trust.

The application should automatically detect any HTTP(s) proxy settings you have at an operating system level, but you can check them here. While not a part of this preference pane, it will also automatically detect any VPN settings you have, allowing access to any containers running within it.

File Sharing

While sharing volumes between Docker containers and the host operating system was possible with Docker Toolbox, it could be slow and suffer permissions issues. Docker for Mac uses a new file system created by Docker called "osxfs." I can’t find much detail on the new file system, but there is some information here.

You can add or remove shared local paths to share with containers using the + and – buttons, but these paths shouldn't overlap (e.g., not Users and Users/homefolder).

Using Docker Natively

Little of the process for using Docker has changed, except that it requires fewer steps. For example, with the application running, you can use Kitematic or the command line to download and start images as containers. Here's the “Hello World” image running in Kitematic:

docker_mac_localhost


Notice something else cool there? No more custom IP addresses to remember! All your Docker containers now run on localhost and will be port mapped to the address.

docker_mac_browser


Other Docker commands, such as docker-compose and docker-machine, work, but for Machine (and thus Swarm) you will need to define a non-native driver. This means you can manage Docker Machine from your Mac, but the machines will still be hosted elsewhere and still need to be managed by the traditional eval $(docker-machine env default) commands.

The Future?

I personally use Docker for rapid testing and prototyping ideas, and so rarely take my containers off my Mac. Of course, few people will use Docker with Mac or Windows in production, so many might ask if there is much point in the Docker team making native applications for these platforms.

Still, a lot of developers will be using these platforms during development, and I for one thank the Docker team for making my experience feel much more friendly and accessible. The applications are still considered betas, and the team welcomes any feedback you have to help them improve, so if you also appreciate the effort made, then help them out.

Related Refcard:

Getting Started With Docker

Docker (software) operating system application

Published at DZone with permission of Chris Ward, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ClickHouse: A Blazingly Fast DBMS With Full SQL Join Support
  • Introduction to NoSQL Database
  • Java REST API Frameworks
  • Master Spring Boot 3 With GraalVM Native Image

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: