最近遇到鏡像導(dǎo)入到docker后無(wú)法啟動(dòng)容器的問(wèn)題,但是上傳到別的服務(wù)器上面又可以正常啟動(dòng)容器,報(bào)錯(cuò)信息大概如下:
There is insufficient memory for the Java Runtime Environment to continue.
Cannot create GC thread. Out of system resources.
An error report file with more information is saved as:
看上去是說(shuō)服務(wù)器資源不足,內(nèi)存不夠,但是執(zhí)行free -h查看了一下內(nèi)存并沒有不足。
最后知道這個(gè)報(bào)錯(cuò)是由于docker創(chuàng)建的容器內(nèi)核版本太低的問(wèn)題,執(zhí)行命令查看內(nèi)核版本:
docker version
如果不是使用root賬號(hào),命令需要加上sudo,信息如下:
?操作系統(tǒng)是amd64,其中runc的版本為1.0.0-rc8,需要將其升級(jí)為1.0.0-rc95
升級(jí)步驟
1.關(guān)閉所有docker容器
一定要關(guān)閉所有docker容器,再關(guān)閉docker服務(wù),不然可能會(huì)出現(xiàn)各種問(wèn)題,如果出現(xiàn)這種情況,按下面的方式解決:
?啟動(dòng)docker報(bào)錯(cuò)如下:
linux> Error response from daemon: mkdir /run/containerd/io.containerd.runtime.v1.linux/moby/189aafa489967asdf23664d32f9e33e121a7b3b6e789d8642345678dfg6ebe13cb: file exists: unknown
linux> Error: failed to start containers: xxx容器id
解決方式:
# 執(zhí)行
linux> ps aux | grep 189aafa489967asdf23664d32f9e33e121a7b3b6e789d8642345678dfg6ebe13cb
# 輸出
linux> root 6358 0.0 0.0 108748 4136 ? Sl Oct27 1:50 containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/189aafa489967asdf23664d32f9e33e121a7b3b6e789d8642345678dfg6ebe13cb -address /run/containerd/containerd.sock -containerd-binary /usr/bin/containerd -runtime-root /var/run/docker/runtime-nvidia
# kill掉再重新start容器即可
kill 6358
?啟動(dòng)docker報(bào)錯(cuò)如下:
Error response from daemon: id already in use
解決方式:
docker stop 容器名稱
2.關(guān)閉docker服務(wù)
#關(guān)閉docker服務(wù),可能需要sudo
systemctl stop docker
3.將runc.amd64文件上傳到 /usr/bin 目錄下
https://download.csdn.net/download/qq_36635569/88067320
4.備份/usr/bin目錄下原有的runc文件
cp /usr/bin/runc /備份目錄
5.將runc.amd64文件重命名為runc,并賦予執(zhí)行權(quán)限
mv runc.amd64 runc
chmod 777 runc
6.啟動(dòng)docker服務(wù)
systemctl start docker
?7.查看docker是否啟動(dòng)成功,執(zhí)行docker version
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-808834.html
runc版本已成功升級(jí)?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-808834.html
到了這里,關(guān)于Docker無(wú)法運(yùn)行java虛擬機(jī)報(bào)錯(cuò)There is insufficient memory for the Java Runtime的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!