【问题标题】:How load docker-machine env inside Jupyter Notebook?如何在 Jupyter Notebook 中加载 docker-machine 环境?
【发布时间】:2019-08-31 23:07:07
【问题描述】:

我正在寻找一种使用我的 python 内核加载 docker-machine env 的方法。现在,当我使用 docker 运行构建时,出现以下错误:

Running S2I version "v1.1.14-dirty"
FATAL: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
make[1]: *** [docker/build] Error 1

如果我使用%%bash 运行,可以,但不常见:

%%bash

eval "$(docker-machine env)"

make docker/build

【问题讨论】:

    标签: docker jupyter-notebook docker-machine


    【解决方案1】:

    在前面加上 eval 可以正常工作:

    !eval "$(docker-machine env)" && make docker/build
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-19
      • 1970-01-01
      • 2018-08-24
      • 2020-04-03
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 2020-09-19
      相关资源
      最近更新 更多