Jenkins is an open-source automation server. The setup consists of a Jenkins controller and two Jenkins agents. Some additional plugins are also installed by default.
To start the Jenkins controller, run
docker compose up --detach
Once the Jenkins container is running, you can access it at http://localhost:8080, using
- Username:
admin
- Password:
admin
Now, to setup the Jenkins agents, visit node-1 and node-2 configuration on the Jenkins controller, get the secrets, and run the below commands
docker container run --rm --init --detach --network jenkins_jenkins_net --name jenkins-agent-1 jenkins/inbound-agent:jdk17 -url http://jenkins:8080 -secret "<SECRET>" -name "node-1" -workDir "/home/jenkins/agent"
docker container run --rm --init --detach --network jenkins_jenkins_net --name jenkins-agent-2 jenkins/inbound-agent:jdk17 -url http://jenkins:8080 -secret "<SECRET>" -name "node-2" -workDir "/home/jenkins/agent"
Go to the Jenkins Script Console and run the following script
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()}")
}
To stop and remove the containers, run
docker container stop jenkins-agent-1 jenkins-agent-2
docker compose down --volumes