Mac上的docker-compose和term2

时间:2016-06-03 12:55:03

标签: macos docker docker-compose docker-machine iterm2

我在Mac上,El-Capitan 10.11.5

直到今天,我能够通过调用“docker quickstart terminal”来运行docker-daemon

然后进入我的项目文件夹并进行docker-compose up

现在,当我跑步时,我一直在

    docker-compose --verbose up --timeout 120


compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Found 'auths' section
docker.auth.auth.parse_auth: Found entry (registry=u'https://index.docker.io/v1/', username=u'my_user')
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose/cli/main.py", line 58, in main
  File "compose/cli/main.py", line 106, in perform_command
  File "compose/cli/command.py", line 34, in project_from_options
  File "compose/cli/command.py", line 79, in get_project
  File "compose/cli/command.py", line 55, in get_client
  File "site-packages/docker/api/daemon.py", line 76, in version
  File "site-packages/docker/utils/decorators.py", line 47, in inner
  File "site-packages/docker/client.py", line 120, in _get
  File "site-packages/requests/sessions.py", line 477, in get
  File "site-packages/requests/sessions.py", line 465, in request
  File "site-packages/requests/sessions.py", line 573, in send
  File "site-packages/requests/adapters.py", line 415, in send
requests.exceptions.ConnectionError: ('Connection aborted.', error(2, 'No such file or directory'))

这个问题有快速解决方案吗?我的版本是

docker-machine version 0.7.0,build a650a40

Docker版本1.11.1,build 5604cbe

docker-compose版本1.7.1,构建0a9ab35

iterm2 Build 3.0.0

虚拟机 版本5.0.20 r106931

1 个答案:

答案 0 :(得分:0)

我只是通过在我的.profile文件中添加以下行来解决此问题

alias docker_compose_run='eval "$(docker-machine env default)" && docker-compose up'

然后我只需运行docker_compose_run