gpt4 book ai didi

docker-compose - 限制 docker-compose v3 中的资源

转载 作者:行者123 更新时间:2023-12-03 12:17:39 24 4
gpt4 key购买 nike

docker-compose.yml 文件的第 3 版不再支持 mem_limit。文档告诉我应该使用 deploy.resources关键是,这部分只对 swarm 或 docker stack 有效。

cpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit: These have been replaced by the resources key under deploy. Note that deploy configuration only takes effect when using docker stack deploy, and is ignored by docker-compose.



... as written in the docs .

如何使用带有 yml 文件的 v3 格式的 docker-compose 设置内存/cpu 限制?

最佳答案

我想知道同样的事情,发现这个:
https://github.com/docker/compose/issues/4513

所以简而言之,这是不可能的,您必须使用 docker-compose 格式的 2.1 版才能指定docker-compose up 不会忽略的限制。

关于docker-compose - 限制 docker-compose v3 中的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42453473/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com