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
environment Centos 6.6 MySQL 5.7 Install If the s...
introduction Let's start with our content. I ...
Table of contents 1. Add users 2. Change the user...
This article shares with you a book flipping effe...
Before reading this article, I hope you have a ba...
Table of contents Binding Class Binding inline st...
Preface Normal business needs: upload pictures, E...
Table of contents 1.MySQL adds or subtracts a tim...
1. What is Docker Secret 1. Scenario display We k...
1. First enter the server's mysql to modify p...
The Linux seq command can generate lists of numbe...
Table of contents 1. Introduction 2. Interface 3....
Description of port availability detection when p...
1. Using it with redis will cause Netty startup c...
Table of contents Deploy httpd with docker contai...