Running jenkins with Docker Compose on Ubuntu 20.04.6 LTS (Focal Fossa)

Running jenkins with Docker Compose on Ubuntu 20.04.6 LTS (Focal Fossa)

- 5 mins

Before Installation of Jenkins with Docker compose?

Prepare Docker Compose File for Jenkins

mkdir docker-compose
cd docker-compose
touch docker-compose.yaml
version: '3.8'
services:
  jenkins:
    image: jenkins/jenkins:lts
    restart: always
    privileged: true
    user: root
    ports:
      - 8080:8080
      - 50000:50000
    container_name: jenkins
    volumes:
      - /home/root/jenkins_compose/jenkins_configuration:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock

Run Docker Compose and Setup Jenkins

docker-compose up -d

jen

docker logs jenkins

jen

Adding Jenkins Agent With Docker Compose

ssh-keygen -t rsa -f jenkins_agent
  agent:
    image: jenkins/ssh-agent:jdk11
    privileged: true
    user: root
    container_name: agent
    expose:
      - 22
    environment:
      - JENKINS_AGENT_SSH_PUBKEY=<YOUR-SSH-KEY>

jen

docker-compose down
docker-compose up -d

jen

jen



:blush: :star: :boom: :fire: :+1: :eyes: :metal:


Guneycan Sanli.


Guneycan Sanli

Guneycan Sanli

A person who like learning, music, travelling and sports.

comments powered by Disqus