Skip to content

Commit 0e3e5a7

Browse files
committed
Deploying to gh-pages from @ beefdb1 🚀
1 parent 5feb3cf commit 0e3e5a7

14 files changed

Lines changed: 62 additions & 43 deletions

File tree

404.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,11 @@
394394

395395

396396
<li class="md-nav__item">
397-
<a href="/cicd-examples/examples/jenkins/dind-jenkins/" class="md-nav__link">
397+
<a href="/cicd-examples/examples/jenkins/jenkins-host-docker/" class="md-nav__link">
398398

399399

400400
<span class="md-ellipsis">
401-
Jenkins with hosts Docker socket
401+
Jenkins with access to hosts Docker engine
402402
</span>
403403

404404

examples/docker/docker-on-wsl/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="prev" href="../../..">
1717

1818

19-
<link rel="next" href="../../jenkins/dind-jenkins/">
19+
<link rel="next" href="../../jenkins/jenkins-host-docker/">
2020

2121

2222
<link rel="icon" href="../../../assets/favicon.png">
@@ -501,11 +501,11 @@
501501

502502

503503
<li class="md-nav__item">
504-
<a href="../../jenkins/dind-jenkins/" class="md-nav__link">
504+
<a href="../../jenkins/jenkins-host-docker/" class="md-nav__link">
505505

506506

507507
<span class="md-ellipsis">
508-
Jenkins with hosts Docker socket
508+
Jenkins with access to hosts Docker engine
509509
</span>
510510

511511

examples/jenkins/ansible-kubernetes/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="canonical" href="https://kangasta.github.io/cicd-examples/examples/jenkins/ansible-kubernetes/">
1414

1515

16-
<link rel="prev" href="../dind-jenkins/">
16+
<link rel="prev" href="../jenkins-host-docker/">
1717

1818

1919
<link rel="next" href="../build-status-pipelines/">
@@ -407,11 +407,11 @@
407407

408408

409409
<li class="md-nav__item">
410-
<a href="../dind-jenkins/" class="md-nav__link">
410+
<a href="../jenkins-host-docker/" class="md-nav__link">
411411

412412

413413
<span class="md-ellipsis">
414-
Jenkins with hosts Docker socket
414+
Jenkins with access to hosts Docker engine
415415
</span>
416416

417417

@@ -668,7 +668,7 @@ <h1 id="deploy-application-to-kubernetes-with-ansible">Deploy application to Kub
668668
<h2 id="prerequisites">Prerequisites</h2>
669669
<p>You will need a running Kubernetes cluster, that supports services with <code>LoadBalancer</code> type, and a kubeconfig file that can be used to deploy application (a deployment and a service) into the cluster.</p>
670670
<h2 id="preparing-the-jenkins-instance">Preparing the Jenkins instance</h2>
671-
<p>The pipeline provided by this example can be added to any Jenkins instance you have administrator access and can run pipeline stages with docker agent. For example, Jenkins configuration from <a href="../dind-jenkins/">Docker-in-Docker</a> example can be used.</p>
671+
<p>The pipeline provided by this example can be added to any Jenkins instance you have administrator access and can run pipeline stages with docker agent. For example, Jenkins configuration from <a href="../jenkins-host-docker/">Jenkins with access to hosts Docker engine</a> example can be used.</p>
672672
<p>We will use secret file to configure credentials for managing the target Kubernetes cluster. To create the secret file credential, open <em>Global credentials</em> from <em>Jenkins</em> credentials store from <a href="http://localhost:8080/credentials/">Manage Jenkins &gt; Manage Credentials</a> and click <em>Add Credentials</em> from the left side menu.</p>
673673
<p>In the <em>New credentials</em> form:</p>
674674
<ol>

examples/jenkins/build-status-pipelines/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@
407407

408408

409409
<li class="md-nav__item">
410-
<a href="../dind-jenkins/" class="md-nav__link">
410+
<a href="../jenkins-host-docker/" class="md-nav__link">
411411

412412

413413
<span class="md-ellipsis">
414-
Jenkins with hosts Docker socket
414+
Jenkins with access to hosts Docker engine
415415
</span>
416416

417417

@@ -648,7 +648,7 @@
648648
<h1 id="build-status-pipelines-and-job-dsl">Build status pipelines and Job DSL</h1>
649649
<p>This example contains pipelines to produce builds with success, unstable, failed, aborted, and not-built statuses as well as Job DSL script to create a folder with projects that have these five different statuses.</p>
650650
<h2 id="preparing-the-jenkins-instance">Preparing the Jenkins instance</h2>
651-
<p>The pipeline provided by this example can be added to any Jenkins instance you have administrator access. For example, Jenkins configuration from <a href="../dind-jenkins/">Docker-in-Docker</a> example can be used.</p>
651+
<p>The pipeline provided by this example can be added to any Jenkins instance you have administrator access. For example, Jenkins configuration from <a href="../jenkins-host-docker/">Jenkins with access to hosts Docker engine</a> example can be used.</p>
652652
<p>In order to be able to run the seed project we will need <a href="https://plugins.jenkins.io/job-dsl/">Job DSL</a> plugin. Install the plugin through Available tab in <a href="http://localhost:8080/pluginManager/available">Manage Jenkins &gt; Manage Plugins</a>.</p>
653653
<h2 id="creating-and-running-the-seed-project">Creating and running the seed project</h2>
654654
<p>To run the job DSL script, create a new pipeline with following script as an inline pipeline script and run the created pipeline.</p>
File renamed without changes.
File renamed without changes.

examples/jenkins/dind-jenkins/index.html renamed to examples/jenkins/jenkins-host-docker/index.html

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212

13-
<link rel="canonical" href="https://kangasta.github.io/cicd-examples/examples/jenkins/dind-jenkins/">
13+
<link rel="canonical" href="https://kangasta.github.io/cicd-examples/examples/jenkins/jenkins-host-docker/">
1414

1515

1616
<link rel="prev" href="../../docker/docker-on-wsl/">
@@ -24,7 +24,7 @@
2424

2525

2626

27-
<title>Jenkins with hosts Docker socket - CI/CD Examples</title>
27+
<title>Jenkins with access to hosts Docker engine - CI/CD Examples</title>
2828

2929

3030

@@ -76,7 +76,7 @@
7676
<div data-md-component="skip">
7777

7878

79-
<a href="#jenkins-with-hosts-docker-socket" class="md-skip">
79+
<a href="#jenkins-with-access-to-hosts-docker-engine" class="md-skip">
8080
Skip to content
8181
</a>
8282

@@ -123,7 +123,7 @@
123123
<div class="md-header__topic" data-md-component="header-topic">
124124
<span class="md-ellipsis">
125125

126-
Jenkins with hosts Docker socket
126+
Jenkins with access to hosts Docker engine
127127

128128
</span>
129129
</div>
@@ -420,7 +420,7 @@
420420

421421

422422
<span class="md-ellipsis">
423-
Jenkins with hosts Docker socket
423+
Jenkins with access to hosts Docker engine
424424
</span>
425425

426426

@@ -431,7 +431,7 @@
431431

432432

433433
<span class="md-ellipsis">
434-
Jenkins with hosts Docker socket
434+
Jenkins with access to hosts Docker engine
435435
</span>
436436

437437

@@ -453,9 +453,18 @@
453453
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
454454

455455
<li class="md-nav__item">
456-
<a href="#jenkins-image-with-docker-in-docker-support" class="md-nav__link">
456+
<a href="#jenkins-image-with-docker-client" class="md-nav__link">
457457
<span class="md-ellipsis">
458-
Jenkins image with Docker-in-Docker support
458+
Jenkins image with Docker client
459+
</span>
460+
</a>
461+
462+
</li>
463+
464+
<li class="md-nav__item">
465+
<a href="#jenkins-container-with-access-to-hosts-docker-engine" class="md-nav__link">
466+
<span class="md-ellipsis">
467+
Jenkins container with access to hosts Docker engine
459468
</span>
460469
</a>
461470

@@ -588,9 +597,18 @@
588597
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
589598

590599
<li class="md-nav__item">
591-
<a href="#jenkins-image-with-docker-in-docker-support" class="md-nav__link">
600+
<a href="#jenkins-image-with-docker-client" class="md-nav__link">
601+
<span class="md-ellipsis">
602+
Jenkins image with Docker client
603+
</span>
604+
</a>
605+
606+
</li>
607+
608+
<li class="md-nav__item">
609+
<a href="#jenkins-container-with-access-to-hosts-docker-engine" class="md-nav__link">
592610
<span class="md-ellipsis">
593-
Jenkins image with Docker-in-Docker support
611+
Jenkins container with access to hosts Docker engine
594612
</span>
595613
</a>
596614

@@ -611,7 +629,7 @@
611629

612630

613631

614-
<a href="https://github.com/kangasta/cicd-examples/edit/main/docs/examples/jenkins/dind-jenkins/README.md" title="Edit this page" class="md-content__button md-icon">
632+
<a href="https://github.com/kangasta/cicd-examples/edit/main/docs/examples/jenkins/jenkins-host-docker/README.md" title="Edit this page" class="md-content__button md-icon">
615633

616634
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4zm10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1z"/></svg>
617635
</a>
@@ -620,18 +638,18 @@
620638

621639

622640

623-
<a href="https://github.com/kangasta/cicd-examples/raw/main/docs/examples/jenkins/dind-jenkins/README.md" title="View source of this page" class="md-content__button md-icon">
641+
<a href="https://github.com/kangasta/cicd-examples/raw/main/docs/examples/jenkins/jenkins-host-docker/README.md" title="View source of this page" class="md-content__button md-icon">
624642

625643
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 18c.56 0 1 .44 1 1s-.44 1-1 1-1-.44-1-1 .44-1 1-1m0-3c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5M9.27 20H6V4h7v5h5v4.07c.7.08 1.36.25 2 .49V8l-6-6H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4.5a8.2 8.2 0 0 1-1.23-2"/></svg>
626644
</a>
627645

628646

629647

630-
<h1 id="jenkins-with-hosts-docker-socket">Jenkins with hosts Docker socket</h1>
648+
<h1 id="jenkins-with-access-to-hosts-docker-engine">Jenkins with access to hosts Docker engine</h1>
631649
<p>Note that by default each of the example docker compose configurations will create their own volumes for the data. This might not be what you want. In order to use the same volumes for every docker compose configuration, run docker compose with <code>-p</code> (or <code>--project-name</code>) option. This can also be done by setting <code>COMPOSE_PROJECT_NAME</code> environment variable:</p>
632650
<div class="language-sh highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nb">export</span><span class="w"> </span><span class="nv">COMPOSE_PROJECT_NAME</span><span class="o">=</span>jenkins
633651
</span></code></pre></div>
634-
<h2 id="jenkins-image-with-docker-in-docker-support">Jenkins image with Docker-in-Docker support</h2>
652+
<h2 id="jenkins-image-with-docker-client">Jenkins image with Docker client</h2>
635653
<p>To be able run Docker commands from inside the Jenkins container, we will need to install the Docker client. This can be done with a suitable Dockerfile:</p>
636654
<div class="language-Dockerfile highlight"><span class="filename">Dockerfile</span><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="k">FROM</span><span class="w"> </span><span class="s">jenkins/jenkins:lts-alpine</span>
637655
</span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>
@@ -644,7 +662,8 @@ <h2 id="jenkins-image-with-docker-in-docker-support">Jenkins image with Docker-i
644662
</span><span id="__span-1-9"><a id="__codelineno-1-9" name="__codelineno-1-9" href="#__codelineno-1-9"></a><span class="c"># Note that the user is not switched back to jenkins here. This is to avoid problems with docker socket permissions.</span>
645663
</span><span id="__span-1-10"><a id="__codelineno-1-10" name="__codelineno-1-10" href="#__codelineno-1-10"></a><span class="c"># Do not use root user in production. Instead, match group IDs of docker groups in host and container and add jenkins user to docker group.</span>
646664
</span></code></pre></div>
647-
<p>When running this container, we will want to define ports and volumes. To do this, we will use a <code>docker-compose.yml</code> configuration:</p>
665+
<h2 id="jenkins-container-with-access-to-hosts-docker-engine">Jenkins container with access to hosts Docker engine</h2>
666+
<p>When running Jenkins in a container, we will want to define ports and volumes. To do this, we will use a <code>docker-compose.yml</code> configuration:</p>
648667
<div class="language-yaml highlight"><span class="filename">docker-compose.yml</span><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="nt">services</span><span class="p">:</span>
649668
</span><span id="__span-2-2"><a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="w"> </span><span class="nt">jenkins</span><span class="p">:</span>
650669
</span><span id="__span-2-3"><a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="w"> </span><span class="nt">build</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">.</span>
@@ -662,8 +681,8 @@ <h2 id="jenkins-image-with-docker-in-docker-support">Jenkins image with Docker-i
662681
</span><span id="__span-2-15"><a id="__codelineno-2-15" name="__codelineno-2-15" href="#__codelineno-2-15"></a><span class="nt">volumes</span><span class="p">:</span>
663682
</span><span id="__span-2-16"><a id="__codelineno-2-16" name="__codelineno-2-16" href="#__codelineno-2-16"></a><span class="w"> </span><span class="nt">jenkins.data</span><span class="p">:</span>
664683
</span></code></pre></div>
665-
<p>These files are available in the repository that provides this website. In order to run Jenkins container with Docker-in-Docker support, <code>cd</code> into <code>docs/examples/jenkins/dind-jenkins</code> directory and run <code>docker compose up</code>.</p>
666-
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="nb">cd</span><span class="w"> </span>docs/examples/jenkins/dind-jenkins
684+
<p>These files are available in the repository that provides this website. In order to run Jenkins container with Docker-in-Docker support, <code>cd</code> into <code>docs/examples/jenkins/jenkins-host-docker</code> directory and run <code>docker compose up</code>.</p>
685+
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="nb">cd</span><span class="w"> </span>docs/examples/jenkins/jenkins-host-docker
667686
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a>
668687
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="c1"># If you want to see logs in the current terminal</span>
669688
</span><span id="__span-3-4"><a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a>docker<span class="w"> </span>compose<span class="w"> </span>up<span class="w"> </span>--build
@@ -697,7 +716,7 @@ <h2 id="jenkins-image-with-docker-in-docker-support">Jenkins image with Docker-i
697716
<span class="md-icon" title="Last update">
698717
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg>
699718
</span>
700-
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 11, 2024</span>
719+
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 12, 2024</span>
701720
</span>
702721

703722

examples/jenkins/parallel-robot-pipeline/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@
407407

408408

409409
<li class="md-nav__item">
410-
<a href="../dind-jenkins/" class="md-nav__link">
410+
<a href="../jenkins-host-docker/" class="md-nav__link">
411411

412412

413413
<span class="md-ellipsis">
414-
Jenkins with hosts Docker socket
414+
Jenkins with access to hosts Docker engine
415415
</span>
416416

417417

@@ -666,7 +666,7 @@
666666
<h1 id="parallel-robot-framework-pipeline">Parallel Robot Framework pipeline</h1>
667667
<p>This directory provides an example of a Jenkins pipeline that executes Robot Framework automation tasks with docker agent in parallel stages as well as combines and stores the produced HTML/XML report files.</p>
668668
<h2 id="preparing-the-jenkins-instance">Preparing the Jenkins instance</h2>
669-
<p>The pipeline provided by this example can be added to any Jenkins instance you have administrator access and can run pipeline stages with docker agent. For example, Jenkins configuration from <a href="../dind-jenkins/">Docker-in-Docker</a> example can be used.</p>
669+
<p>The pipeline provided by this example can be added to any Jenkins instance you have administrator access and can run pipeline stages with docker agent. For example, Jenkins configuration from <a href="../jenkins-host-docker/">Jenkins with access to hosts Docker engine</a> example can be used.</p>
670670
<p>In order to be able to run the pipeline we will need <a href="https://plugins.jenkins.io/docker-workflow/">Docker Pipeline</a> and <a href="https://plugins.jenkins.io/robot/">Robot Framework</a> plugins. Install these plugins through <em>Available</em> tab in <a href="http://localhost:8080/pluginManager/available">Manage Jenkins &gt; Manage Plugins</a> and restart the Jenkins instance after these plugins have been installed. The restart can be done, for example, from the plugins page or by restarting the container with <code>docker compose down</code> and <code>docker compose up</code>.</p>
671671
<h2 id="configure-the-pipeline">Configure the pipeline</h2>
672672
<p>First, create a new pipeline via <em><a href="http://localhost:8080/view/all/newJob">New Item</a></em> button in the rigth side menu of the Jenkins dashboard. The name of the pipeline could be for example <code>Screenshots</code> and it should be an pipeline.</p>

examples/jenkins/sonarqube-jenkins/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3"
22
services:
33
jenkins:
4-
build: ../dind-jenkins/
4+
build: ../jenkins-host-docker/
55
ports:
66
# Web user interface
77
- 8080:8080

0 commit comments

Comments
 (0)