This guide demonstrates how I integrated Jenkins with my Discord bot for CI/CD tasks.
- Any Linux OS.
- Docker installed.
This is done by inputting the command
sudo docker run -p 8080:8080 -p 50000:50000 -d -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
- Runs on port 8080 as its the default web server port.
- Exposes port 50000 for master/slave communication.
-d
runs in detached mode allowing the container to run in the background.-v jenkins_home:/var/jenkins_home
binds the volume jenkins_home to the system directory/var/jenkins_home
.
Input to retrieve active docker containers:
sudo docker ps
Output of previous command
Now input this and scroll up to retrieve the first sign in password:
sudo docker logs <CONTAINER ID>
Scroll up to see something like this. Copy and Paste the password string
Afterwards, Jenkins can be accessed at localhost:8080
(on local machine) or <IP SUBNET>:8080
if the container is running on a VM.