Recommended Docker learning materials: https://www.runoob.com/docker/docker-tutorial.html 1. Centos7 environment docker installation First go to the official website to download the image, docker image official: https://hub.docker.com/ 1. Install the latest version yum install -y yum-utils device-mapper-persistent-data lvm2 2. Add docker source yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 3. Install Docker yum install docker-ce Note: Check whether Docker is installed? yum list installed | grep docker If you want to uninstall, you can enter the command: yum remove xxx xxxx xxx 4. Set DNS, accelerator, and bind IP in { "dns" : [ "114.114.114.114", "8.8.8.8" ], #Accelerator, which can increase the speed of downloading images. You can also configure it to the Alibaba Cloud mirror address "registry-mirrors": ["https://registry-docker.com"], "bip":"172.17.5.1/24" } 5. After installation, check the docker version and information docker version docker info 6. Set Docker to start when the virtual machine starts sudo chkconfig docker on 7. Start Docker sudo service docker start 2. Install Jenkins with docker 1. Generally, for the convenience of management, customize the IP segment of the container. Here I customize my network name: mynetwork docker network create --subnet=172.18.0.0/16 mynetwork The definition is complete and can be viewed: 2. Download the jinkins image: docker pull jenkins/jenkins:latest 3. Authorize the container account In order to prevent Jenkins from reinstalling when migrating or recreating the container, you need to mount the data in the corresponding directory during the first installation. In my case, I mount the data to this directory: chown -R 1000 /home/docker/data/jenkins 4. Create a container and start it when Linux starts, and specify a fixed IP docker run --net mynetwork --ip 172.18.0.4 -v /home/docker/data/project/jenkins:/home/docker/data/jenkins -v /home/docker/var/jenkins/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime -e JAVA_OPTS=-Duser.timezone=Asia/Shanghai -dit --name my-jenkins -p 8080:8080 -p 50000:50000 --restart=always jenkins/jenkins:latest explain: 2. Note: The port number 6. Installation is successful, check: docker ps -a | grep jenkins 5. Enter the container: docker exec -it -u root my-jenkins /bin/bash Default user: 6. Install the vim command in the container for the first time: apt-get update apt-get install vim 7. There are two ways to exit the container: Summarize This is the end of this article about installing jenkins container in docker environment. For more information about installing jenkins container in docker environment, please search 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:
|
<<: Native JS to implement real-time clock
>>: How to quickly repair corrupted MySQL database files using the myisamchk and mysqlcheck tools
Anyone who has a little knowledge of data operati...
This article shares the specific code of JS to ac...
Database application is an indispensable part of ...
Physically speaking, an InnoDB table consists of ...
MySQL database reports ERROR 1045 (28000): Access...
nginx Nginx (engine x) is a high-performance HTTP...
<div align="center"> <table sty...
Table of contents 1. Brief Introduction 2. setInt...
1. First go to the official website https://www.p...
1. The div css mouse hand shape is cursor:pointer;...
Table of contents 1. Array deconstruction 2. Obje...
Table of contents 1. Implement the $(".box1&...
Apache Log4j2 reported a nuclear-level vulnerabil...
Configuring network connectivity for Linux system...
Hash Join Hash Join does not require any indexes ...