Brew安装docker不包括docker引擎?

试图从brew安装docker,但是引擎似乎不包括在任何官方公式中。

brew install docker-machine docker-compose

所以这些只安装客户端? 引擎/守护程序没有酒桶吗?< / p >

205869 次浏览

请试着跑步

brew install docker

这将安装Docker引擎,这将需要Docker- machine (+ VirtualBox)在Mac上运行。

如果你想安装更新的 Docker for Mac,也就是不需要virtualbox,你可以通过Homebrew的Cask来安装:

brew install --cask docker
open /Applications/Docker.app

以下步骤在macOS Sierra 10.12.4上运行正常。注意,在brew安装Docker之后,docker命令(符号链接)在/usr/local/bin中不可用。第一次运行Docker应用程序会创建这个符号链接。请参阅下面的详细步骤。

  1. < p >安装码头工人。

    brew install --cask docker
    
  2. < p >启动码头工人。

    • + 空间调出焦点搜索,输入Docker启动Docker。
    • 在“Docker需要特权访问”对话框中,单击“好吧”。
    • 输入密码,单击“好吧”。

    当Docker以这种方式启动时,状态菜单中会出现一个Docker鲸鱼图标。一旦鲸鱼图标出现,dockerdocker-composedocker-credential-osxkeychaindocker-machine的符号链接就会在/usr/local/bin中创建。

    $ ls -l /usr/local/bin/docker*
    lrwxr-xr-x  1 susam  domain Users  67 Apr 12 14:14 /usr/local/bin/docker -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker
    lrwxr-xr-x  1 susam  domain Users  75 Apr 12 14:14 /usr/local/bin/docker-compose -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker-compose
    lrwxr-xr-x  1 susam  domain Users  90 Apr 12 14:14 /usr/local/bin/docker-credential-osxkeychain -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker-credential-osxkeychain
    lrwxr-xr-x  1 susam  domain Users  75 Apr 12 14:14 /usr/local/bin/docker-machine -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker-machine
    
  3. 单击状态菜单中的docker whale图标,等待它显示Docker正在运行

    enter image description here enter image description here < / p >

  1. 测试docker工作正常。

    $ docker run hello-world
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    78445dd45222: Pull complete
    Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
    Status: Downloaded newer image for hello-world:latest
    
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    
    
    To generate this message, Docker took the following steps:
    1. The Docker client contacted the Docker daemon.
    2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
    4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
    
    
    To try something more ambitious, you can run an Ubuntu container with:
    $ docker run -it ubuntu bash
    
    
    Share images, automate workflows, and more with a free Docker ID:
    https://cloud.docker.com/
    
    
    For more examples and ideas, visit:
    https://docs.docker.com/engine/userguide/
    
    
    $ docker version
    Client:
    Version:      17.03.1-ce
    API version:  1.27
    Go version:   go1.7.5
    Git commit:   c6d412e
    Built:        Tue Mar 28 00:40:02 2017
    OS/Arch:      darwin/amd64
    
    
    Server:
    Version:      17.03.1-ce
    API version:  1.27 (minimum version 1.12)
    Go version:   go1.7.5
    Git commit:   c6d412e
    Built:        Fri Mar 24 00:00:50 2017
    OS/Arch:      linux/amd64
    Experimental: true
    

使用自制软件安装Mac Docker:

brew install homebrew/cask/docker

安装命令行补全:

brew install bash-completion
brew install docker-completion
brew install docker-compose-completion
brew install docker-machine-completion

为了重新安装docker,你应该运行:

brew reinstall homebrew/cask/docker

如果运行brew install docker, Docker桌面将不会被安装。如果你已经用这种方式安装了它,首先用brew uninstall docker卸载它。

安装Docker Desktop,运行:

brew install homebrew/cask/docker

从你的/Applications文件夹启动docker一次并输入密码,然后你可以运行像docker --version这样的命令来验证CLI是否正常工作。

Mac版Docker桌面版对于企业Docker用户来说不是一个合适的选择,因为它需要付费许可证才能使用。牧场主桌面是适用于所有三个主要操作系统的Docker Desktop的一个可行的开源替代方案。

由于这个问题是专门针对Mac OS用户的,所以我添加了使其在Mac OS上工作的步骤。

  1. 使用自制软件安装Docker brew install docker < / p >

  2. 安装牧场桌面。

  3. Kubernates Settings中,将容器运行时更改为dockerd

利润!

更新:场景中还有另一个开源容器运行时,名为Colima (https://github.com/abiosoft/colima)。