Docker工具箱无法分配内存

问题描述 投票:3回答:2

我正在尝试让Docker在我一直在云中工作的Mac上本地运行一个容器。我做了docker commit / save / load查找。但是当我在安装docker toolbox之后必须在本地运行它时,出现此错误

docker logs es-loaded-with-data
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006c5330000, 4207738880, 0) failed; error='Cannot allocate memory' (errno=12)
Starting elasticsearch: #
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 4207738880 bytes for committing reserved memory.
# An error report file with more information is saved as:
# //hs_err_pid16.log

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006c5330000, 4207738880, 0) failed; error='Cannot allocate memory' (errno=12)
Starting elasticsearch: #

如果我这样做docker info然后我得到

总内存:1.956 GiB

显然2 Gb还不够。如何增加它以便我的容器运行?

docker boot2docker
2个回答
2
投票

Mac OS上的Docker在带有docker-machine(或更旧的boot2docker)的virtualbox VM内运行。我不确定docker-machine是否支持直接修改VM RAM,但是您可以直接启动VirtualBox.app并直接修改VM Memory的数量。重新启动虚拟机。


0
投票

重新启动docker服务为我解决了问题。

© www.soinside.com 2019 - 2024. All rights reserved.