Giter Site home page Giter Site logo

jenkins-101's Introduction

YouTube Link

For the full 1 hour course watch on youtube: https://www.youtube.com/watch?v=6YZvp2GwT0A

Installation

Build the Jenkins BlueOcean Docker Image (or pull and use the one I built)

docker build -t myjenkins-blueocean:2.414.2 .

#IF you are having problems building the image yourself, you can pull from my registry (It is version 2.332.3-1 though, the original from the video)

docker pull devopsjourney1/jenkins-blueocean:2.332.3-1 && docker tag devopsjourney1/jenkins-blueocean:2.332.3-1 myjenkins-blueocean:2.332.3-1

Create the network 'jenkins'

docker network create jenkins

Run the Container

MacOS / Linux

docker run --name jenkins-blueocean --restart=on-failure --detach \
  --network jenkins --env DOCKER_HOST=tcp://docker:2376 \
  --env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 \
  --publish 8080:8080 --publish 50000:50000 \
  --volume jenkins-data:/var/jenkins_home \
  --volume jenkins-docker-certs:/certs/client:ro \
  myjenkins-blueocean:2.414.2

Windows

docker run --name jenkins-blueocean --restart=on-failure --detach `
  --network jenkins --env DOCKER_HOST=tcp://docker:2376 `
  --env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 `
  --volume jenkins-data:/var/jenkins_home `
  --volume jenkins-docker-certs:/certs/client:ro `
  --publish 8080:8080 --publish 50000:50000 myjenkins-blueocean:2.414.2

Get the Password

docker exec jenkins-blueocean cat /var/jenkins_home/secrets/initialAdminPassword

Connect to the Jenkins

https://localhost:8080/

Installation Reference:

https://www.jenkins.io/doc/book/installing/docker/

alpine/socat container to forward traffic from Jenkins to Docker Desktop on Host Machine

https://stackoverflow.com/questions/47709208/how-to-find-docker-host-uri-to-be-used-in-jenkins-docker-plugin

docker run -d --restart=always -p 127.0.0.1:2376:2375 --network jenkins -v /var/run/docker.sock:/var/run/docker.sock alpine/socat tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
docker inspect <container_id> | grep IPAddress

Using my Jenkins Python Agent

docker pull devopsjourney1/myjenkinsagents:python

jenkins-101's People

Contributors

devopsjourney1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jenkins-101's Issues

Node affinity conflict

Hi,
I get the following error during deploying jenkins to minikube: 1 node(s) had volume node affinity conflict minikube. My volume data:

kubectl get pvc -n devops-tools
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
jenkins-pv-claim Bound jenkins-pv-volume 10Gi RWO local-storage 25m

kubectl get pv jenkins-pv-volume
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
jenkins-pv-volume 10Gi RWO Retain Bound devops-tools/jenkins-pv-claim local-storage 25m

Any idea?

[Discussion] Getting `jenkins` communication issue with docker daemon

Hi @devopsjourney1! I have hard finding about setting up jenkins pipeline with docker agent. Since I have followed these steps from the docs here, but when I try to follow the steps from ur video, I am failing to create a label docker agent.

Is it necessary to install jenkins through docker to establish connection b/w docker host and jenkins server?

When I skip the docker installation as I have done through kubernetes and follow the docker socket connection like this docker network create jenkins and docker run -d --restart=always -p 127.0.0.1:2376:2375 --network jenkins -v /var/run/docker.sock:/var/run/docker.sock alpine/socat tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock, I still fail to make the connection successful. Any thoughts here plz?

Git clone error

Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/my-python-project
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository https://github.com/devopsjourney1/jenkins-101
### > git init /var/jenkins_home/workspace/my-python-project # timeout=10
Fetching upstream changes from https://github.com/devopsjourney1/jenkins-101

git --version # timeout=10
git --version # 'git version 2.30.2'
git fetch --tags --force --progress -- https://github.com/devopsjourney1/jenkins-101 +refs/heads/:refs/remotes/origin/ # timeout=10
git config remote.origin.url https://github.com/devopsjourney1/jenkins-101 # timeout=10
git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
Avoid second fetch
git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision 3123824 (refs/remotes/origin/master)
git config core.sparsecheckout # timeout=10
git checkout -f 3123824 # timeout=10
Commit message: "Update readme.md"
First time build. Skipping changelog.
[my-python-project] $ /bin/sh -xe /tmp/jenkins16577520687614105209.sh

  • python3 hellowworld.py
    python3: can't open file '/var/jenkins_home/workspace/my-python-project/hellowworld.py': [Errno 2] No such file or directory
    Build step 'Execute shell' marked build as failure
    Finished: FAILURE

Docker file needs to be updated

docker file needs to be upadated to point to latest version of jenkins.

FROM jenkins/jenkins:lts-jdk11

USER root

RUN apt-get update && apt-get install -y lsb-release

RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc
https://download.docker.com/linux/debian/gpg

RUN echo "deb [arch=$(dpkg --print-architecture)
signed-by=/usr/share/keyrings/docker-archive-keyring.asc]
https://download.docker.com/linux/debian
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list

RUN apt-get update && apt-get install -y docker-ce-cli

USER jenkins

Update the Blue Ocean plugin version to the latest available

RUN jenkins-plugin-cli --plugins "blueocean:latest docker-workflow:1.28"

Dockerfile isn't works anymore

When you build Dockerfile provided, an error occurs:
#0 0.559 Package docker-ce is not available, but is referred to by another package. #0 0.559 This may mean that the package is missing, has been obsoleted, or #0 0.559 is only available from another source #0 0.559 #0 0.559 Package docker-ce-cli is not available, but is referred to by another package. #0 0.559 This may mean that the package is missing, has been obsoleted, or #0 0.559 is only available from another source

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.