> Docker安装教程 > 实战构建jdk-jenkins

实战构建jdk-jenkins

要求

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
下载官方 Tomcat软件包通过解压然后下载jenkins包 打包在Tomcat你面
├── backup  历史dockerfile
│   ├── Dockerfile_v001
│   ├── Dockerfile_v002
│   ├── Dockerfile_v003
│   ├── Dockerfile_v004
│   ├── Dockerfile_v005
│   ├── Dockerfile_v006
│   └── Dockerfile_v007
├── Dockerfile
├── Dockerfile.JDK
├── jdk-8u191-linux-x64.tar.gz
└── Jenkins.tar.gz


[root@Docker openjdk]# cat Dockerfile
# docker build -t jenkins:v1 .
# docker run -itd --name jenkins001 --hostname jenkins001 --volume /home/jenkins001:/root/.jenkins -p 8081:8080 jenkins:v1
FROM centos:7.9.2009
MAINTAINER limaolin 2021-5-31 13:24:42
RUN yum install openssh-clients -y
ADD jdk-8u191-linux-x64.tar.gz /usr/local/
ENV JAVA_HOME /usr/local/jdk1.8.0_191
ENV CLASSPATH $JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
ENV PATH $JAVA_HOME/bin:$PATH
ADD Jenkins.tar.gz  /usr/local/
EXPOSE 8080
WORKDIR /root/.jenkins
ENV DIR /usr/local/Jenkins/bin
CMD   ["/bin/bash","-c","$DIR/catalina.sh run"]
[root@Docker openjdk]# cat Dockerfile.JDK
#docker build -t jdk8:v1 -f Dockerfile.JDK .
#docker run -itd --name jdk001 --hostname jdk001 --privileged --volume /home/jenkins002:/home/Jenkins -p 6021:22 jdk8:v1
FROM centos:7.9.2009
MAINTAINER limaolin 2021-5-31 13:24:42
ADD jdk-8u191-linux-x64.tar.gz /usr/local/
RUN mkdir -pv /home/Jenkins
WORKDIR  /home/Jenkins
ENV JAVA_HOME /usr/local/jdk1.8.0_191
ENV CLASSPATH $JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
ENV PATH $JAVA_HOME/bin:$PATH
RUN yum install -y openssh-server net-tools
RUN echo 1|passwd --stdin root
RUN ssh-keygen -A
ENTRYPOINT /usr/sbin/init
EXPOSE  22
CMD /usr/sbin/sshd -D

[root@Docker openjdk]#

实战构建jdk-jenkins

支付宝赞助
微信赞助