Home  >  Article  >  Operation and Maintenance  >  How to install Docker on Mac OS

How to install Docker on Mac OS

尚
forward
2020-05-11 17:49:046503browse

How to install Docker on Mac OS

Use Homebrew to install

macOS We can use Homebrew to install Docker.

Homebrew's Cask already supports Docker for Mac, so you can easily use Homebrew Cask to install:

$ brew cask install docker

==> Creating Caskroom at /usr/local/Caskroom
==> We'll set permissions properly so we won't need sudo in the future
Password:          # 输入 macOS 密码
==> Satisfying dependencies
==> Downloading https://download.docker.com/mac/stable/21090/Docker.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask docker
==> Installing Cask docker
==> Moving App 'Docker.app' to '/Applications/Docker.app'.
  docker was successfully installed!

After loading the Docker app, click Next, you may be asked about your macOS Just enter the login password. After that, a prompt window for Docker running will pop up, and there will also be a little whale icon on the status bar.

Manual download and installation

If you need to download manually, please click the link below to download the Stable or Edge version of Docker for Mac.

Like other macOS software, installation is very simple. Just double-click the downloaded .dmg file and drag the whale icon to the Application folder.

How to install Docker on Mac OS

Find the Docker icon from the application and click Run. You may be asked for your macOS login password, enter it.

How to install Docker on Mac OS

Click the whale icon in the top status bar to pop up the operation menu.

How to install Docker on Mac OS

#When you click the icon for the first time, you may see the installation success interface. Click "Got it!" to close this window.

How to install Docker on Mac OS

#After starting the terminal, you can check the installed Docker version through the command.

$ docker --version
Docker version 17.09.1-ce, build 19e2cf6

Image acceleration

In view of domestic network problems, subsequent pulling of Docker images is very slow. We may need to configure an accelerator to solve the problem. I am using the NetEase image address. : http://hub-mirror.c.163.com.

Click the Docker for mac application icon on the taskbar -> Perferences... -> Daemon -> Registry mirrors. Just fill in the accelerator address in the list. After the modification is completed, click the Apply & Restart button, and Docker will restart and apply the configured image address.

Afterwards we can check whether the configuration is successful through docker info.

$ docker info
...
Registry Mirrors:
 http://hub-mirror.c.163.com
Live Restore Enabled: false

Recommended: "MacOS Tutorial"

The above is the detailed content of How to install Docker on Mac OS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:runoob.com. If there is any infringement, please contact admin@php.cn delete