Skip to content

Instantly share code, notes, and snippets.

@deependhamecha
Last active June 11, 2022 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deependhamecha/b7c253fb8f3eaa02a1a8327159512b87 to your computer and use it in GitHub Desktop.
Save deependhamecha/b7c253fb8f3eaa02a1a8327159512b87 to your computer and use it in GitHub Desktop.
Jenkins

Jenkins

Installation

Install docker and docker compose plugin.

docker pull jenkins/jenkins

To know where docker is saving the executable

docker info | grep -i root

Space docker is taking

sudo du -sh /var/lib/docker

Create a directory jenkins-data in home directory.

List images from docker

docker images

Copy REPOSITORY name of jenkins

version: '2'
services:
	jenkins:
		container_name: jenkins
		image: jenkins/jenkins
    ports:
      - "8080:8080"
    volumes:
      - "$PWD/jenkins_home:/var/jenkins_home"
    networks:
      - net
networks:
  net:

sudo chown 1000:1000 jenkins_home -R

if you get error regarding $PWD then replace $PWD with .

Now, run the jenkins image:

docker compose up

This will start docker image.

Now, hit 127.0.0.1:8080 from browser and password will be seen in the terminal logs. If you missed the password then do

docker logs jenkins -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment