【Docker】 Failed to start thread “GC Thread#0“ - pthread_create failed (EPERM) for attributes: stacks

时间:2025-03-30 11:47:26
启动docker 容器时 报错内存不足:
INSTALL WARNING: User:  missing rw permissions on JENKINS_HOME: /var/jenkins_home
[0.004s][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:
# /tmp/hs_err_pid7.log

尝试了修改jvm内存也没有生效:

最终解决方法: 

docker run -d --name jenkins -p 8083:8080 -v jenkins_volume:/var/jenkins_home --privileged=true jenkins/jenkins:lts

启动docker时加上参数 --privileged=true

privileged=true:获得真正的root权限