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

时间:2017-11-16 00:24:04

标签: docker

运行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
  • systemd 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.

1 个答案:

答案 0 :(得分:1)

vc.0.0.0-rc4的runc -console option was replaced--console-socket Dec 2016 {{3}}。

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

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

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