如何增加/检查Docker在Linux上的默认内存? [英] How to increase/check default memory Docker has on linux?

查看:70
本文介绍了如何增加/检查Docker在Linux上的默认内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到在Windows和Mac上更改给定的RAM容器非常容易-您只需进入GUI.但是,如何在Linux上做到这一点呢?在Linux上,它是CLI而不是GUI?

I've seen that on Windows and Mac it's very easy to change the RAM containers are given - you just go into the GUI. But how do you do this on Linux, where it's a CLI instead of a GUI?

Docker文档中提到了-m标志,但是该标志没有给出任何响应(只是再次打印整个帮助输出),所以我不知道它是否有效.它似乎还特定于容器,而我想更改全局默认值.

The Docker docs it mention an -m flag, but this flag doesn't give any response (just prints the entirety of the help output again) so I don't know whether it worked. It also seems specific to containers, whereas I'd like to change the global default.

最后,有没有一种方法可以检查当前的默认RAM,因此我可以确保最终所做的一切都能正常工作?

Lastly, is there a way to check the current default RAM, so I can make sure whatever I do in the end actually worked?

推荐答案

在本机Linux上,Docker可以使用所有可用的主机内存.它使用基于内核的轻量级隔离机制,该机制通常使用标准内核机制共享CPU内核和内存(以及在现代安装中的磁盘空间)等资源.没有控制或设置来限制或增加此限制.

On native Linux, Docker can use all available host memory. It uses a lightweight kernel-based isolation mechanism that generally shares resources like CPU cores and memory (and on modern installations, disk space) using the standard kernel mechanism. There isn't a control or setting to limit or increase this.

在其他平台上,Docker运行一个隐藏的Linux VM,从而能够运行Linux内核以使用这些隔离机制,并且Docker Desktop内存控制会影响该VM的内存分配.

On other platforms Docker runs a hidden Linux VM to be able to run a Linux kernel to use these isolation mechanisms, and the Docker Desktop memory control affects the memory allocation for that VM.

这篇关于如何增加/检查Docker在Linux上的默认内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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