Detailed tutorial on deploying Jenkins based on docker

Detailed tutorial on deploying Jenkins based on docker

0. When I made this document, it was around December 2019, and er2.200 was the latest version.

1. Download the image

docker pull jenkins/jenkins 

Be sure to install the latest version of Jenkins. Many plug-ins cannot be installed with the old version.

2. View detailed information of Jenkins

docker inspect jenkins:2.200 

3. Create a jenkins directory (for persistence)

mkdir /home/jenkins_home

4. Start the container

docker run -d --name Jenkins_01 -p 8081:8080 -v \

/home/jenkins_home:/home/jenkins_home jenkins:2.200 

【Note】You may encounter iptables problems:

iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8080 -j DNAT

--to-destination 192.168.40.142:8080 ! -i br-ff45d935188b: iptables: No

chain/target/match by that name. (exit status 1)

Restart Docker

systemctl restart docker

5. Check whether the started jenkins container is healthy

docker ps | grep jenkins 

6. Web access ip:port

7. Enter the container

docker exec -it Jenkins_01 /bin/bash 

8. Follow the prompts to view the password (in the container)

cat /var/jenkins_home/secrets/initialAdminPassword 

Sun has tested

This is the end of this article about the detailed tutorial on deploying Jenkins based on docker. For more relevant content about deploying Jenkins with docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Method of realizing automated deployment based on Docker+Jenkins
  • Docker container uses Jenkins to deploy web projects (summary)
  • Jenkins builds Docker image example
  • Implementation of Jenkins+Docker continuous integration
  • Analysis of containerized technology architecture jenkins docker k8s script

<<:  Implementing a web player with JavaScript

>>:  Method of realizing automated deployment based on Docker+Jenkins

Recommend

Difference between MySQL btree index and hash index

In MySQL, most indexes (such as PRIMARY KEY, UNIQ...

How to use Greek letters in HTML pages

Greek letters are a very commonly used series of ...

Understanding and usage scenarios of ES6 extension operators

Table of contents 1. Replace the apply method, ge...

Toolkit: A more powerful front-end framework than Bootstrap

Note: Currently, the more popular front-end frame...

Linux CentOS6.9 installation graphic tutorial under VMware

As a technical novice, I am recording the process...

20 CSS coding tips to make you more efficient (sorted)

In this article, we would like to share with you ...

CocosCreator Universal Framework Design Network

Table of contents Preface Using websocket Constru...

How to insert Emoji expressions into MySQL

Preface Today, when I was designing a feedback fo...

A brief introduction to MySQL database optimization techniques

A mature database architecture is not designed wi...

Code for implementing simple arrow icon using div+CSS in HTML

In web design, we often use arrows as decoration ...

Detailed explanation of hosts file configuration on Linux server

Linux server hosts file configuration The hosts f...

Linux sar command usage and code example analysis

1. CPU utilization sar -p (view all day) sar -u 1...

Detailed explanation of Vue's seven value transfer methods

1. From father to son Define the props field in t...

Practical example of Vue virtual list

Table of contents Preface design accomplish summa...