Jenkins构建 Dockerfile
# Docker for CentOS 7
#Base image
FROM hfq/centos7:Jurassic
#http://mirrors.jenkins-ci.org/war/latest/jenkins.war
#https://pkg.jenkins.io/redhat-stable/
ADD supervisord.conf /etc/supervisord.conf
#安装supervisor=============================重点=================================
RUN yum -y install python-setuptools
RUN easy_install supervisor
ARG jenkins_home=/var/lib/jenkins
ARG user=root
#ARG user=jenkins
#ARG group=jenkins
#ARG uid=1000
#ARG gid=1000
ENV JENKINS_HOME ${jenkins_home}
ENV JENKINS_USER ${user}
#RUN groupadd -g ${gid} ${group} && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user}
RUN \
wget -O /etc/yum.repos.d/jenkins.repo https:
&& rpm --import https:
&& yum -y install jenkins
#创建的挂载点
VOLUME ["/shimanqiang","/weijianglong","/wangxin","/zhangfengchao","/zangxufeng","/liqiang"]
#VOLUME ${jenkins_home}
USER ${user}
EXPOSE 8080
CMD /usr/bin/supervisord -c /etc/supervisord.conf
###############################################构建脚本####################################
#构建image镜像
#docker build -t hfq/centos7:Jenkins .
#docker build -t hfq/jenkins:v1 .
#启动container后台运行提供sshd服务
#docker run -d -P --name <container name> hfq/centos7:Jenkins
#进入sshd启动的container
#docker exec -it <container name or id> /bin/bash
#docker rm $(docker ps -a | grep "xxx/jedi:v5" | awk '{print $1}')
#操作记录
#docker run -d -p 9090:8080 -P --name hfq-jedi-Jenkins hfq/centos7:Jenkins
#http://47.93.114.117:9090
#docker run -d -p 9091:8080 -P --name JenkinsV1 hfq/jenkins:v1
supervisord.conf
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
autostart=true
autorestart=true
[program:jenkins]
command=nohup java -jar /usr/lib/jenkins/jenkins.war &