skip to Main Content

I’m setting up a docker compose file which starts jenkins, then an agent. I had many errors in my config, so I got a lot of errors when the agent started. Now I fixed them, and I only get this output on my console:

jenkins-node-1 exited with code 0

When running agent.jar on my local machine, the call is blocking and appears in jenkins. But here it just shuts down. That’s my node service so far:

node-1:
    image: jenkins/agent
    depends_on:
      jenkins:
        condition: service_healthy
    privileged: true
    container_name: jenkins-node-1
    environment:
      - JENKINS_URL=http://jenkins:8080
      - JENKINS_AGENT_NAME=node-1
    networks:
      - jenkins-net

What am I doing wrong here?

2

Answers


  1. Chosen as BEST ANSWER

    I had to add the command to the docker-compose file to actually call the agent:

    command: java -jar /usr/share/jenkins/agent.jar -jnlpUrl http://jenkins:8080/computer/node%2D1/jenkins-agent.jnlp
    

  2. go to Jenkins -> Manage Jenkins -> Manage Nodes
    examine the node that is running everything

    Check in it’s configuration to ensure the total # of executors is greater than 0 and that it is online.

    Then try redownloading the agent.jar file.

    More info on that here:
    https://www.edureka.co/community/69051/how-to-increase-no-of-executors-in-jenkins

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search