在 Windows 中部署 Docker 堆栈 [英] Docker stack deploy in windows

查看:25
本文介绍了在 Windows 中部署 Docker 堆栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 docker 堆栈窗口中有一些问题.

i have some questions in docker stack windows.

我们可以在 windows 2016 中启用 docker stack 吗.它是否完全支持.

Can we enable docker stack in windows 2016. Is it fully supported.

如果是,我们如何启用.我们如何使用此文件自动创建 swarm 集群.我已经搜索过谷歌,但找不到与 Windows 相关的内容.如果您有任何学习链接,请提供给我.

if yes, how can we enable. how we can automate creating swarm cluster using this file. i have searched google but can't find related to windows. please provide me If you have any links to study.

推荐答案

Docker 堆栈在某种程度上与 docker-compose 等效,但在 swarm 中.堆栈是在堆栈文件中定义的多个服务的组合.您在 docker swarm 上部署了一个堆栈,这会导致在该 swarm 中创建多个服务.

Docker stack is somehow the equivalent for docker-compose but in swarm. A stack is a composition of multiple services defined in a stack file. You deploy a stack on a docker swarm which results in the creation of multiple services in that swarm.

您首先需要通过运行 docker swarm init 创建一个 swarm,然后通过运行 docker stack deploy --compose-file stack-file.yml 将堆栈部署到 swarm<堆栈名称>.请注意,您使用的同一个 docker compose 文件可用于以 swarm 模式部署容器.

You need first to have a swarm created by running docker swarm init and then you deploy the stack to the swarm by running docker stack deploy --compose-file stack-file.yml <stack-name>. Note that the same docker compose file you use, can be used to deploy the containers in swarm mode.

这篇关于在 Windows 中部署 Docker 堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆