Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
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
languagebash
sudo docker pull jenkins
sudo docker images

Step 2 : create a jenkins.sh file under /data directory

Code Block
languagebash
sudo vi jenkins.sh

add below startup script in Jenkins.sh file for running the Jenkins in a container

Code Block
languagebash
#!/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
languagebash
./jenkins.sh (or) 
sudo sh jenkins.sh


Step 3 :
Pulling the latest jenkins image from docker hub

Code Block
languagebash
sudo docker ps