...
Code Block |
---|
|
sudo apt-get update
sudo apt install openjdk-8-jdk |
Install Docker
Step 1: First, in order to ensure the downloads are valid, add the GPG key for the official Docker repository to your system
...
Setting up the Peer Jenkins server
Step 1 : Pulling the latest jenkins image from docker hub
Code Block |
---|
|
sudo docker pull jenkins
sudo docker images |
Step 2 : create a jenkins.sh file under /data directory
Code Block |
---|
|
sudo vi jenkins.sh
|
add below startup script in Jenkins.sh file for running the Jenkins in a container
Code Block |
---|
|
#!/bin/bash
export DROOT=/data
export DOMAIN=your.domain.name
docker run --detach --name jenkins --restart=always --hostname jenkins.$DOMAIN --volume $DROOT/jenkins:/var/jenkins_home --volume /var/run/docker.sock:/var/run/docker.sock --publish 80:8080 jenkins/jenkins
|
save the changes and run the script using below command
Code Block |
---|
|
./jenkins.sh (or)
sudo sh jenkins.sh
|
Step 3 : Pulling the latest jenkins image from docker hub