docker堆栈命令不在docker命令列表中

docker堆栈命令不在docker命令列表中,docker,Docker,docker堆栈不在docker命令列表中 但它很好用。是虫子还是什么?以下是docker的命令列表: Management Commands: config Manage Docker configs container Manage containers image Manage images network Manage networks node Manage Swarm nodes plugin Mana

docker堆栈
不在docker命令列表中

但它很好用。是虫子还是什么?以下是docker的命令列表:

Management Commands:
  config      Manage Docker configs
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.
如您所见,没有
stack
命令

这是我的docker版本:

☁  docker-research [master] ⚡  docker version
Client:
 Version:   18.03.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    0520e24
 Built: Wed Mar 21 23:06:22 2018
 OS/Arch:   darwin/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:  18.05.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.1
  Git commit:   f150324
  Built:    Wed May  9 22:20:42 2018
  OS/Arch:  linux/amd64
  Experimental: false
更新1


我还认为
stack
命令是否会显示在swarm节点中?因此,我使用
docker机器ssh myvm1'docker'
进行测试不幸的是,仍然没有
堆栈
命令

命令在那里,但是

$ docker stack ls
Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.
您必须在swarm模式下运行Docker引擎

从:

在swarm模式下运行Docker Engine时,可以使用
Docker stack deploy
将完整的应用程序堆栈部署到swarm。
deploy
命令接受一个格式为的堆栈描述

注意:如果您正在本地开发环境中进行尝试,您可以使用
docker swarm init
将引擎置于swarm模式

如果您已经运行了多节点swarm,请记住所有
docker stack
docker service
命令都必须从管理器节点运行


我同意@novaline,它似乎是文档中的一个bug

另外,如果您尝试
docker stack--help

您将获得:

Usage:  docker stack COMMAND

Manage Docker stacks

Options:


Commands:
  deploy      Deploy a new stack or update an existing stack
  ls          List stacks
  ps          List the tasks in the stack
  rm          Remove one or more stacks
  services    List the services in the stack

Run 'docker stack COMMAND --help' for more information on a command.

我知道docker引擎可以在单主机模式和群集模式下运行<代码>docker堆栈--help工作正常。所以我认为关键是为什么列表中没有显示
stack
命令
docker stack ls
docker stack deploy
docker swarm init
docker machine create-d virtualbox myvm1
,我想所有这些都不是我要问的问题。我明白你的意思。由于某些原因,它们未列为可用命令(即使启用了swarm模式)。让我们看看经验更丰富的Docker用户是否有答案:)