【问题标题】:Error creating Docker container in Bluemix在 Bluemix 中创建 Docker 容器时出错
【发布时间】:2015-10-13 11:16:58
【问题描述】:

要在 Bluemix 中创建 Docker 容器,我们需要安装容器插件和容器扩展。安装容器扩展后,Docker 应该正在运行,但它显示错误:

    root@oc0608248400 Desktop]# cf ic login
    ** Retrieving client certificates from IBM Containers
    ** Storing client certificates in /root/.ice/certs
    Successfully retrieved client certificates
    ** Checking local docker configuration
    Not OK
    Docker local daemon may not be running. You can still run IBM Containers on the cloud

There are two ways to use the CLI with IBM Containers:

Option 1) This option allows you to use `cf ic` for managing containers on IBM Containers while still using the docker CLI directly to manage your local docker host. 
    Leverage this Cloud Foundry IBM Containers plugin without affecting the local docker environment:


    Example Usage:
    cf ic ps
    cf ic images
Option 2) Leverage the docker CLI directly. In this shell, override local docker environment to connect to IBM Containers by setting these variables, copy and paste the following:

    Notice: only commands with an asterisk(*) are supported within this option


    export DOCKER_HOST=tcp://containers-api.ng.bluemix.net:8443
        export DOCKER_CERT_PATH=/root/.ice/certs
        export DOCKER_TLS_VERIFY=1
    Example Usage:
    docker ps
    docker images

exec: "docker": $PATH 中找不到可执行文件

请建议我下一步该做什么。

【问题讨论】:

  • 您能否编辑您的问题,以便清楚您运行了什么命令,输出是什么,...?
  • 看来您的 docker 配置不正确。您可以尝试运行任何 docker 命令吗?比如“docker images”或“docker ps”?

标签: docker containers ibm-cloud


【解决方案1】:

错误已经告诉你该怎么做:

exec: "docker": executable file not found in $PATH

表示查找可执行文件docker

因此,以下内容应该告诉您它的位置,并且需要附加到 PATH 环境变量中。

dockerpath=$(dirname `find / -name docker -type f -perm /a+x 2>/dev/null`)
export PATH="$PATH:$dockerpath"

这将做的是在文件系统的根目录中搜索一个名为“docker”的文件,并在忽略错误消息的同时设置可执行位,并将文件的绝对路径作为 $dockerpath 返回。然后它会临时导出它。

【讨论】:

  • 另外需要注意的是:选项1)这个选项允许你使用cf ic来管理IBM Containers上的容器是告诉你使用IBM的docker wrapper。跨度>
【解决方案2】:

问题似乎是您的 docker 守护程序没有运行。

尝试运行:

sudo docker restart

如果你刚刚安装了 docker,你可能需要先重启你的机器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-28
    • 2015-10-19
    • 1970-01-01
    • 1970-01-01
    • 2019-02-03
    • 2022-11-03
    • 1970-01-01
    相关资源
    最近更新 更多