通过命令行的Mac上安装泊坞窗工具箱 [英] Install Docker Toolbox on a Mac via command line

查看:272
本文介绍了通过命令行的Mac上安装泊坞窗工具箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图自动设置在Mac开发环境。该安装程序的一部分安装泊坞窗工具箱。我无法找到如何通过命令行做这个的任何文档。我如何可以自动完成这一安装(必须通过命令行触发)?

I am trying to automate setting up a developer environment on Mac. Part of that setup is installing the Docker Toolbox. I cannot find any documentation on how do to this via command line. How can I automate this installation (must be triggered via command line)?

推荐答案

我发现,码头工人的工具箱可通过BREW /桶

I found that Docker Toolbox is available via brew/cask

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Cask
brew install caskroom/cask/brew-cask
# Install docker toolbox
brew cask install dockertoolbox

一旦安装泊坞窗工具箱,你可以设置使用获取与泊坞窗机引导启动。

# create the docker machine
docker-machine create --driver "virtualbox" myBoxName

# start the docker machine
docker-machine start myBoxName

# this command allows the docker commands to be used in the terminal
eval "$(docker-machine env myBoxName)"

# at this point can run any "docker" or "docker-compose" commands you want
docker-compose up

在这个过程结束,增加的eval$(泊坞窗机ENV myBoxName)你的的.bash_profile 或当您打开一个新的shell或终端你会得到下面的错误。

At the end of this process, add eval "$(docker-machine env myBoxName)" to your .bash_profile or you will get the following error when you open a new shell or terminal.

无法连接到多克尔守护进程。这是主机上运行的泊坞窗守护?

如果您打开终端后启动泊坞窗容器,您可以运行的eval$(泊坞窗机ENV myBoxName)手动,或重新装载的bash的个人资料( 源在〜/ .bash_profile )。

If you start the docker container after opening the terminal, you can either run eval "$(docker-machine env myBoxName)" manually, or reload your bash profile (source ~/.bash_profile).

这篇关于通过命令行的Mac上安装泊坞窗工具箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆