🗺️博客地图
一、报错发现
docker run -it -d --name halo -p 8090:8090 halohub/halo
使用docker run启动容器,容器启动不了,容器内报错如下:
[0.003s][warning]
[os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached.
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create worker GC thread. Out of system resources.
# An error report file with more information is saved as:
# /application/hs_err_pid7.log
报错原因主要是因为启动线程“GC线程#0”失败,通常是因为容器的安全策略(如seccomp)限制了线程的创建。
二、解决方式
解决这个问题的方法是在docker run命令中添加--security-opt seccomp=unconfined
参数,这样可以解除对线程创建的限制,从而解决启动失败的问题。
docker run --security-opt seccomp=unconfined -it -d --name halo -p 8090:8090 halohub/halo
三、测试结果
浏览器访问http://IP地址:8090,可以正常访问
完美,打完收功!