-
Run the virtual machine (it'll take some minutes):
vagrant up jenkins
-
Copy jenkins' admin password:
vagrant ssh jenkins -c "sudo cat /var/lib/jenkins/secrets/initialAdminPassword" | clipcopy
-
Configure Jenkins:
Open http://localhost:9090/.
At this point jenkins will ask you for the
Administrator password
, paste it, and install suggested plugins.Then, you have to create the
First Admin User
. -
Install Plugins:
Go to http://localhost:9090/manage/pluginManager/available.
Search for
Docker
and selectDocker
andDocker Pipeline
Search for
Copy Artifact
and selectCopy Artifact
.Click on
Install
.Additional, on the installation page, check the option
Restart Jenkins when installation is complete and no jobs are running
, and wait until it finishes. -
Create a test pipeline:
On the Jenkins' landing page http://localhost:9090/, click on
New Item
and putTest Docker
as name.Then select
Pipeline
and click onOK
.Scroll down onto
Script
, and paste next code:pipeline { agent { docker { image 'eclipse-temurin:17-jdk' } } stages { stage('Test') { steps { echo 'Hello World!' sh 'java --version' } } } }
Then click on
Save
.Finally, click on
Build Now
.