Linux Docker Installation Jenkins

Source: Internet
Author: User
Tags administrator password

Installation Environment
    • Operating system centos7.3

    • Installing Docker, installation and configuration see Docker Docker Introduction and installation Configuration

Install Jenkins Download Jenkins

Command:sudo docker pull jenkins

Ready to create before starting Jenkins jenkinsFolder

Create a Jenkins folder for disk-mounted and in-container folders

Command:mkdir /home/hzq/jenkins

Note: When you install Jenkins, the attribution user ID that hangs in the folder /home/hzq/jenkins/ must be 1000, otherwise the no ACTION permission exception will be thrown. Exceptions are as follows:

Why does the attribution user ID of a folder have to be 1000?

For the first time I contacted Jenkins, it was really depressing. Why does the UID have to be 1000? With a question I went to see the dockerfile provided in the Docker Central warehouse, where I saw the following code:

View folder's attribution

Command:ls -nd 文件夹名称

To modify the ownership and group of folders

Command:sudo chown -R 1000:1000 jenkins/

Start Jenkins start Jenkins

Command:

-itd -p 8080:8080 -p 50000:50000 --name jenkins --privileged=true -v /home/hzq/jenkins:/var/jenkins_home jenkins
    • 1
    • -p 8080:8080 -p 50000:50000Making Port Mappings

    • --privileged=trueThe security module in the CentOS7 SELinux has restricted the permissions, the parameters to the container plus privileges.

    • -v /home/hzq/jenkins:/var/jenkins_homeDisk Mount

View Run status

Command:sudo dockers ps

First use JENKINS1, get the Administrator password:

Enter the "localhost:8080" in the browser to enter Jenkins, the first time you need to get the administrator's password,

Get Password Method One:

When Jenkins starts, we set the folder to hang, so we can view the password directly in the local Jenkins directory:

Get Password Method Two:

Get password when not hanging on disk

Command:sudo docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

There is actually another way to get inside the container using the Attach command, and then look at the password. This way of operation is too cumbersome, not explained here.
Through the above method, get to the password and enter Jenkins.

2, configure the network agent (do not need to go online through the agent Skip)

Because the personal network needs to configure the agent to surf the internet, so this belongs to the offline status, click “Confirure Proxy” Set Agent below.

3, install the plug-in

You can customize the installation plug-in, or you can install the recommended plugins.


To start the installation:

4. Create user

5. Complete

Linux Docker Installation Jenkins

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.