docker stack不在停靠命令列表中。
但效果很好。是虫子还是什么?下面是停靠者的命令列表:
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-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命令会显示在群集节点中吗?所以,我用docker-machine ssh myvm1 'docker'做了一个测试。不幸的是,仍然没有stack 命令。
发布于 2018-06-29 08:52:04
我同意@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.发布于 2018-06-29 08:39:05
命令在那里但是..。
$ 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.你必须用蜂群模式运行码头引擎。
来自文档
在群集模式下运行Docker引擎时,可以使用
docker stack deploy将完整的应用程序堆栈部署到群集中。deploy命令以合成文件的形式接受堆栈描述。 Note:如果您要在本地开发环境上进行尝试,可以使用docker swarm init将引擎放入群集模式中。 如果已经有多节点群在运行,请记住,所有docker stack和docker service命令都必须从管理器节点中运行。
https://stackoverflow.com/questions/51097217
复制相似问题