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

Detailed explanation of vue simple notepad development

This article example shares the specific code of ...

SQL implementation of LeetCode (175. Joining two tables)

[LeetCode] 175.Combine Two Tables Table: Person +...

A guide to writing flexible, stable, high-quality HTML and CSS code standards

The Golden Rule Always follow the same set of cod...

Practical MySQL + PostgreSQL batch insert update insertOrUpdate

Table of contents 1. Baidu Encyclopedia 1. MySQL ...

How to deal with time zone issues in Docker

background When I was using Docker these two days...

How to use Web front-end vector icons

Preface When writing front-end pages, we often us...

How to analyze SQL execution plan in MySQL through EXPLAIN

Preface In MySQL, we can use the EXPLAIN command ...

Introduction to the use of html base tag target=_parent

The <base> tag specifies the default address...

Vue3 draggable left and right panel split component implementation

Table of contents Breaking down components Left P...

Linux remote control windows system program (three methods)

Sometimes we need to remotely run programs on the...

MySQL 8.0.15 version installation tutorial connect to Navicat.list

The pitfalls 1. Many tutorials on the Internet wr...

Attributes in vue v-for loop object

Table of contents 1. Values ​​within loop objects...

MySql5.7.21 installation points record notes

The downloaded version is the Zip decompression v...

In-depth explanation of Session and Cookie in Tomcat

Preface HTTP is a stateless communication protoco...

How to solve the mysql error 1033 Incorrect information in file: 'xxx.frm'

Problem Description 1. Database of the collection...