如何增加docker容器的预分配内存? [英] How to increase the pre-assigned memory of docker container?

查看:586
本文介绍了如何增加docker容器的预分配内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建Docker容器时分配了2GB RAM作为docker容器的最大内存限制。现在需要更多的内存,有没有办法增加现有容器的最大RAM限制?

I have assigned 2GB of RAM memory as maximum memory limit for the docker container while creating the same. Now that more memory is required, is there way to increase the maximum RAM limit for the existing container?

我使用以下命令创建了容器。

I used the following command to create the container.

docker run --name=mysql_50000 -m 2g -p 50000:3306 mysql_docker_image_v4

工作正常。我的容器的最大内存限制为2GB。我现在需要3GB。任何帮助表示赞赏。谢谢

It worked fine as expected. My container has a maximum memory limit of 2GB. I need it to be 3GB now. Any help is appreciated. Thanks

推荐答案

请使用带有适当参数的 docker update 命令( -m 3G )。请参阅文档:
https://docs.docker.com/engine/reference / commandline / update /

Please use docker update command with appropriate parameters (-m 3G). See doc: https://docs.docker.com/engine/reference/commandline/update/

这篇关于如何增加docker容器的预分配内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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