Docker: Alpinelinux Install Jenkins

Source: Internet
Author: User
Tags docker run
This is a creation in Article, where the information may have evolved or changed.

The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53816615 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys

1, installing Jenkins

Jenkins is a powerful tool for continuous construction. It's a very handy tool.
The simplest way to install it is to use the Docker image on the website directly.
/jenkins/">https://hub.docker.com//jenkins/
Direct pull on the line:

dockerpulljenkins:alpine

But here you have to toss it yourself, download the JDK, and then install it at 1.1 points.

2, Write Dockerfile

First, unlike the previous study, this requires the JDK, not the JRE.
Because you want to compile other Java projects.
Encounter a problem: Jenkins got java.awt.headless problem
Https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+got+java.awt.headless+problem
Need to install Ttf-dejavu. You also need to install Git.

# Alpinelinux Install Jenkins with JDKFrom Alpine:latest# Install CURLRUNEcho - e "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main\n\https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/ Community ">/etc/apk/repositoriesrun apk--update Add Curl bash openjdk8 ttf-dejavu git && \ rm-rf/var/cache/apk/*# Set EnvironmentENV java_home/usr/lib/jvm/default-jvmenv PATH${path}:${java_home}/binrun mkdir-p/optcopy Tomcat/opt/tomcat# Set EnvironmentENV tomcat_home/opt/tomcatenv PATH${path}:${tomcat_home}/binentrypoint ["/opt/tomcat/bin/catalina.sh","Run"]expose8080

Put both Tomcat and JENKNS under the current directory.

mkdir/ data/jenkinsCD/ data/jenkinswgetHttp://mirrors.jenkins.io/war-stable/latest/jenkins.warUnzipJenkins.war-dROOTmkdir-P/ data/jenkins/logsmkdir-P/ data/jenkins/tempmkdir-P/ data/jenkins/jenkins_dataChcon-Rtsvirt_sandbox_file_t/ data/jenkins/logsChcon-Rtsvirt_sandbox_file_t/ data/jenkins/tempChcon-Rtsvirt_sandbox_file_t/ data/jenkins/jenkins_dataChcon-Rtsvirt_sandbox_file_t/ data/jenkins/ROOT 

Compile:

-t demo/tomcat-openjdk8:1.0.

3, running run

docker run -d  -p  8080 : 8080  -v /data /jenkins/root:/opt/tomcat/ Webapps/root \  -v / data /jenkins/logs:/opt/tomcat/logs -v /< Span class= "hljs-built_in" >data /jenkins/temp:/opt/tomcat/temp \  -v /data /jenkins/jenkins_data:/root /  Jenkins -- name Tomcat-jenkins  demo/tomcat< Span class= "Hljs-attribute" >-openjdk8 : 1.0  

Startup scripts are more complex.
One is the home directory of Jenkins, put configuration. One is the root of Jenkins.
And two are Tomcat's logs and temp.

4, configuring Jenkins

After the configuration is started.

Need to see the following password:

There is a MD5 password to enter before the next step.

Choose several plugins that you need. No use, no choice, fast installation speed.


The installation is successful and you can log in by setting a user name password.
The rest of Jenkins is easy to use.
Previously written with a parameter configured:
http://blog.csdn.net/freewebsys/article/details/43758465

5, summary

The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53816615 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys

The simplest way to do this is to download the Docker's Jenkins for installation.
Build yourself, install your own way to install the benefits of being customizable.
Everything needs to be installed on their own, do not need to uninstall. And Jenkins itself is a war pack for Tomcat.
installation is very convenient.

Related Article

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.