Docker Windows 容器内存限制 [英] Docker windows container memory limit

查看:43
本文介绍了Docker Windows 容器内存限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

带有 Docker Desktop for Windows 的 docker windows 容器是否有默认内存限制?我有一个应用程序在容器中运行时崩溃,但是当我尝试为 docker run 命令指定 --memory 2048mb 参数时,它似乎运行良好.至少在它之前崩溃的情况下.这给我的印象是存在默认内存限制,但我在文档中找不到它.所以我的问题是有内存限制,如果有记录的地方?

Does docker windows containers, with Docker Desktop for Windows, have default memory limit? I have an application that was crashing when I run it in the container, but when I tried to specify --memory 2048mb parameter to the docker run command it seems to run fine. At least in the scenario where it was crashing before. This gives me impression that there is default memory limit, but I could not find it in the documentation. So my question is there memory limit and if it is where it is documented?

推荐答案

根据 Docker for windows Github 问题的讨论 (https://github.com/moby/moby/issues/31604),当 Docker for Windows 在 Windows 10 下运行时,它实际上使用的是 Hyper-V 隔离模型(而进程模型是在 Win 10 场景中无法访问).

According to talks on Docker for windows Github issues (https://github.com/moby/moby/issues/31604), when Docker for Windows is run under Windows 10, it is actually using a Hyper-V isolation model (and process model is not accessible in Win 10 scenario).

在这种隔离类型中,您的容器在轻量级 VM 中运行,该 VM 有默认限制,为 1 Gb.因此,如果您想拥有更多内存,则应使用 -m 参数.

And in that isolation type, your container is run inside a lightweight VM, which DOES have a default limit, and it is 1 Gb. So if you want to have more memory you should use -m param.

这篇关于Docker Windows 容器内存限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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