Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
docker run hello world的结果是;不正确的用法“;错误:";已提供但未定义的标志:-console";_Docker - Fatal编程技术网

docker run hello world的结果是;不正确的用法“;错误:";已提供但未定义的标志:-console";

docker run hello world的结果是;不正确的用法“;错误:";已提供但未定义的标志:-console";,docker,Docker,运行docker run hello world时,我收到一个“不正确使用”错误(完整输出粘贴在下面)。我正在运行以下程序: Docker 17.05.0-ce,构建89658be docker containerd 0.2.3(提交9048e5e) runc v1.0.0-rc4 Linux内核4.1.15 使用buildroot 2017.11(提交1f1a242)生成自定义工具链/rootfs 系统D 234 似乎我可以正确地下拉hello world图像,因为它包含在docker i

运行
docker run hello world
时,我收到一个“不正确使用”错误(完整输出粘贴在下面)。我正在运行以下程序:

  • Docker 17.05.0-ce,构建89658be
  • docker containerd 0.2.3(提交9048e5e)
  • runc v1.0.0-rc4
  • Linux内核4.1.15
  • 使用buildroot 2017.11(提交1f1a242)生成自定义工具链/rootfs
  • 系统D 234
似乎我可以正确地下拉hello world图像,因为它包含在
docker images
输出中。想知道docker/containerd/runc之间是否存在不兼容?或者是一些显而易见的事情?第一次和docker一起工作

此外,我还运行了一个docker check-config.sh脚本,我发现该脚本中只有我缺少的内核配置功能是可选的。它们是CONFIG_CGROUP_PIDS、CONFIG_CGROUP_HUGETLB、CONFIG_AUFS_FS、/dev/zfs、zfs命令和zpool命令。其他所有功能(包括所有必需功能)均已启用


输出:

# docker run hello-world
[  429.332968] device vethc0d83d1 entered promiscuous mode
[  429.359681] IPv6: ADDRCONF(NETDEV_UP): vethc0d83d1: link is not ready
Incorrect Usage.

NAME:
   docker-runc create - create a container

USAGE:
   docker-runc create [command options] <container-id>

Where "<container-id>" is your name for the instance of the container that you
are starting. The name you provide for the container instance must be unique on
your host.

DESCRIPTION:
   The create command creates an instance of a container for a bundle. The bundle
is a directory with a specification file named "config.json" and a root
filesystem.

The specification file includes an args parameter. The args parameter is used
to specify command(s) that get run when the container is started. To change the
command(s) that get executed on start, edit the args parameter of the spec. See
"runc spec --help" for more explanation.

OPTIONS:
   --bundle value, -b value  path to the root of the bundle directory, defaults to the current directory
   --console-socket value    path to an AF_UNIX socket which will receive a file descriptor referencing the master end of the console's pseudoterminal
   --pid-file value          specify the file to write the process id to
   --no-pivot                do not use pivot root to jail process inside rootfs.  This should be used whenever the rootfs is on top of a ramdisk
   --no-new-keyring          do not create a new session keyring for the container.  This will cause the container to inherit the calling processes session key
   --preserve-fds value      Pass N additional file descriptors to the container (stdio + $LISTEN_FDS + N in total) (default: 0)

flag provided but not defined: -console
[  429.832198] docker0: port 1(vethc0d83d1) entered disabled state
[  429.849301] device vethc0d83d1 left promiscuous mode
[  429.859317] docker0: port 1(vethc0d83d1) entered disabled state
docker: Error response from daemon: oci runtime error: flag provided but not defined: -console.
#docker run hello world
[429.332968]设备VETC0D83D1进入混乱模式
[429.359681]IPv6:ADDRCONF(网络开发):vethc0d83d1:链接未就绪
不正确的用法。
姓名:
docker runc create-创建容器
用法:
docker runc创建[命令选项]
其中“”,是您要创建的容器实例的名称
我们正在开始。为容器实例提供的名称在上必须是唯一的
你的主人。
说明:
create命令为bundle创建容器的实例。包裹
是一个包含名为“config.json”的规范文件和根目录的目录
文件系统。
规范文件包含一个args参数。使用args参数
指定启动容器时运行的命令。改变现状
开始时执行的命令,编辑规范的args参数。请参阅
“runc规范--帮助”以获取更多解释。
选项:
--bundle value,-b指向bundle目录根目录的值路径,默认为当前目录
--控制台套接字值指向AF_UNIX套接字的路径,该套接字将接收引用控制台伪终端主端的文件描述符
--pid文件值指定要将进程id写入的文件
--no pivot不要在rootfs中使用pivot根到进程。只要rootfs位于ramdisk的顶部,就应该使用它
--无新密钥环不为容器创建新会话密钥环。这将导致容器继承调用进程会话密钥
--preserve fds value将N个附加文件描述符传递到容器(stdio+$LISTEN\u fds+N总计)(默认值:0)
已提供但未定义的标志:-控制台
[429.832198]docker0:端口1(VETC0D83D1)进入禁用状态
[429.849301]设备VETC0D83D1左混杂模式
[429.859317]docker0:端口1(VETC0D83D1)进入禁用状态
docker:来自守护进程的错误响应:oci运行时错误:已提供但未定义标志:-控制台。
v1.0.0-rc4的runc中有

所以我猜您需要一个较旧版本的runc或更新版本的Docker

如果您自己正在构建Docker,请使用Docker 17.09.0-ce或更早版本的runc。我不确定这是v0.1.1还是像v1.0.0-rc2这样的早期1.0


如果您正在升级软件包,则说明安装出现问题。可能会清除所有内容并重新安装Docker

看起来dockerd和runc的版本不匹配。您是自己构建的吗?我是通过buildroot构建自己的,但是由我的buildroot版本构建的docker/runc的默认版本似乎与
-console
/
-console socket
不匹配。我将在明天早上升级docker版本并重建以确认。这些信息非常有用,谢谢!已验证降级runc修复了兼容性问题。通知buildroot开发人员,他们将在即将发布的2017.11版本中将runc恢复为旧版本。希望将所有与docker相关的软件包升级到最新版本,以便在2018年发布。