my jenkins docker container is alway die because memory usage
Issue:
today I'm facing problem casued java memory usage is huge and make my container always
die, an I found how to restart my container automatically when it die caused error
solution is simple:
jus add line to my jenkins docker-compose.yaml like this
add
restart: unless-stopped
version: "3.7"
services:
jenkins:
image: talenthrms/talent_jenkins
privileged: true
user: root
# command: sh -c "apt update && apt install -y sshpass"
environment:
- JENKINS_OPTS="--prefix=/jenkins"
- "ES_JAVA_OPTS=-Xms1024m -Xmx2048m"
ports:
- 8085:8080
- 8086:50000
container_name: jenkins
under jenkins service line code
version: "3.7"
services:
jenkins:
image: talenthrms/talent_jenkins
privileged: true
restart: unless-stopped # <== new line
user: root
# command: sh -c "apt update && apt install -y sshpass"
environment:
- JENKINS_OPTS="--prefix=/jenkins"
- "ES_JAVA_OPTS=-Xms1024m -Xmx2048m"
ports:
- 8085:8080
- 8086:50000
container_name: jenkins
and then restart the jenkins
with docker-compose up -d container will re create
Comments
Post a Comment