如何在Docker容器中增加/ dev / shm的大小 [英] How to increase the size of the /dev/shm in docker container

查看:1210
本文介绍了如何在Docker容器中增加/ dev / shm的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,当我创建新的docker容器时,共享内存目录的大小限制为64MB。但是,由于我的应用程序依赖于此共享内存,因此我需要增加此大小。
是否可以增加docker容器中/ dev / shm的大小?
我听说Docker代码中硬编码了64MB,如何从源代码安装docker并更改/ dev / shm的值?

Currently When I create new docker container the size of the shared memory directory is limited to 64MB. But, I need to increase this size since my application depend on this shared memory. Is there any way to increase the size of /dev/shm in docker container? I heard that the 64MB is hard coded in the docker code, How to install docker from source and change the value of the /dev/shm?

推荐答案

您可以通过将可选参数-shm-size 传递给 docker run 命令。默认值为64MB。

You can modify shm size by passing the optional parameter --shm-size to docker run command. The default is 64MB.

例如:

docker run -it --shm-size=256m oracle11g /bin/bash

这篇关于如何在Docker容器中增加/ dev / shm的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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