我正在尝试让Docker在我的mac上本地运行一个容器,我一直在云端工作。我做了docker commit / save / load find。但是当我在安装docker工具箱后在本地运行它时,我得到了这个错误
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
然后我得到
显然2 Gb是不够的。如何增加它以便我的容器运行?总记忆:1.956 GiB
答案 0 :(得分:2)
Mac OS上的Docker在带有docker-machine(或更旧的boot2docker)的虚拟机VM中运行。我不确定docker-machine是否支持直接修改VM RAM,但您可以直接启动VirtualBox.app
并修改VM Memory的数量。重新启动VMetvoilá。
答案 1 :(得分:0)
重启docker服务为我解决了这个问题。