docker工运行hello-world结果在“不正确的用法”错误:“标志提供但未定义: – 控制台”

当运行docker run hello-world我得到一个“不正确的用法”错误(全部输出粘贴下面)。 我正在运行以下内容:

  • Docker 17.05.0-ce,build 89658be
  • docker-containerd 0.2.3(commit 9048e5e)
  • runc v1.0.0-rc4
  • Linux内核4.1.15
  • 使用buildroot 2017.11(commit 1f1a242)生成自定义工具链/ rootfs
  • 系统234

似乎我可以正确拉下hello-world图像,因为它包含在docker images输出中。 想知道是否有docker / containerd / runc之间的不兼容? 或者也许明显的东西? 第一次与docker工作。

另外,我运行了一个docker check-config.sh脚本,我发现只有我缺less的内核configurationfunction是可选的。 它们是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. 

-c 选项在2016年12月的 runc版本中用--console-socket 代替 v1.0.0-rc4。

所以我想你需要一个老版本的runc或更新版本的Docker。

如果您自己构buildDocker,请使用Docker 17.09.0-ce或较旧版本的runc。 我不确定这是v0.1.1,还是只是v1.0.0-rc2之类的早期版本1.0

如果你正在升级软件包,安装出了问题。 大概清除一切,重新安装Docker。