install Docker in Mac

Docker is an open-source project that automates the deployment of applications inside software containers. Docker CE(Community Edition) for Mac is an easy-to-install desktop app for building, debugging, and testing Dockerized apps on a Mac.

1. system requirement

Docker for Mac works on OS X El Capitan 10.11 and newer macOS releases.

2. download Docker installation package

The stable Docker image for Mac can be downloaded with link.

3. install

Double-click Docker.dmg in your download folder, and follow the installation process.

After the installation is completed, goto Launchpad and start Docker by clicking the icon. After that, the whale in the top status bar shows that Docker is running, and accessible from a terminal.

4. test and run

Open a terminal, and try out some Docker commands to make sure it’s properly installed.

  • Run docker version to check that you have the latest release installed.

  • Run docker run hello-world to verify that Docker is pulling images and running as expected.

Tips for developer from Windows to Linux

Switching developing environment from Windows to Mac is painful for me. There’re many picky settings in MacOS. I’ll keep updating the issues I meet, and hope that can help others.

1. firewall

By default, it has a strict policy for firewall, and may block your application, especially some back-end connections. I was confused why the same code can run in Eclipse on Windows, and exist without error message in Mac.

The solution is quite straightforward for me, turn off firewall by following System Preferences -> Security & Privacy -> Firewall -> Turn Off Firewall. Surely you can keep it on, and update the configuration by open Firewall Options.

2. Screen Saver

In Windows, it’s easy to lock screen by Shift+Control+Delete. In Mac, the choice is keychain.

To enable it, first click the search icon in the right-top banner, and enter keychain in the Spotlight Search. Then, go to Keychain Access -> Preferences, and choose Show keychain status in menu bar. Now you could see the keychain icon in right-top banner as well. By clicking Lock Screen, it’s done.

3. Home/PageUp/PageDown/End

There’s no Home/PageUp/PageDown/End icons in Mac’s keyboard. Now you can use fn key and left/right/up/down arrows to map as below:

  • fn+left_arrow -> Home
  • fn+right_arrow -> End
  • fn+up_arrow -> PageUp
  • fn+down_arrow -> PageDown

4. Screen Grab

It’s very easy to grab any part of screen now with Mac, with Shift+Command+4, you can choose any part, and save a PNG file in Desktop automately.

5. open multiple Eclipse

By simply click Eclipse icon with Launchpad, you can only open one Eclipse. To open more than one instance, it’s doable using terminal:

cd /Applications/Eclipse.app/Contents/MacOS
./eclipse &