Thursday, April 4, 2019

Installing Jenkins with Docker in new approach

Install Jenkins

  • Running Jenkins as a Docker container
  • Interacting with the Docker host from Jenkins

$ docker volume create jenkins

To identify docker group id
$ getent group docker
docker:x:998:vagrant

Run the container and to save the jenkins configuration into jenkins volume
$ docker run -v jenkins:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --group-add 998 --name jenkins dockerhp/jenkins


$ docker run -v jenkins:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --group-add 998 -d --name jenkins dockerhp/jenkins 

To figure out the ip address of jenkins
$ docker inspect -f '{{.NetworkSettings.Networks.bridge.IPAddress}}' jenkins
172.17.0.2

To view the secret password
$ docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword


Install plugin
Git plugin

No comments:

Post a Comment

free online comma separating tool

https://delim.co/#