Memory limit should be smaller than already set memoryswap limit, update the memoryswap at the s...

一、 报错现象

执行场景:当对容器执行docker update时发生报错

[root@hecs-296579 ~]# docker update --memory 1024m nacos
Error response from daemon: Cannot update container 8745862388d8f2fae023fa226356a15714ce02790729ba7e31b41672dc342fcc: Memory limit should be smaller than already set memoryswap limit, update the memoryswap at the same time
[root@hecs-296579 ~]# 

报错信息:

Memory limit should be smaller than already set memoryswap limit, update the memoryswap at the same time

二.、解决方法

方法1、执行以下命令

[root@hecs-296579 ~]# docker update --memory 1024 m --memory-swap -1 nacos
nacos 
[root@hecs-296579 ~]#

查看内存状态

截屏2024-01-30 11.45.35.png

方法2、执行以下命令

重建容器,在创建时指定–memory,之后再扩展就不会报错了

新建容器

docker run -it -d --name nacos --memory 512m nacos/nacos-server:2.0.3

扩展内存

docker update --memory 1024m nacos

文章持续更新中、希望对各位有所帮助、有问题可留言 大家共同学习 !

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容