File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,11 @@ RUN mkdir -p /opt/jenkins/data/
1313RUN mv ~/jenkins.war /opt/jenkins
1414RUN ln -s /opt/apache-maven-3.2.3 /opt/maven
1515RUN ln -s /opt/jenkins/data/m2home /root/.m2
16+ ADD start.sh /opt/jenkins/start.sh
1617
1718
1819EXPOSE 8080
1920
20- CMD /usr/bin/java -Duser.timezone=${TZ} -jar / opt/jenkins/jenkins.war
21+ CMD /opt/jenkins/start.sh
2122
2223
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ docker run --name "jenkinsdata" -v /opt/jenkins/data tianon/true
2323## How to use Jenkins with the data container
2424
2525```
26- docker run -d -p 8080:8080 --name "jenkins" --volumes-from jenkinsdata -v /etc/timezone :/etc/timezone :ro codingtony/jenkins
26+ docker run -d -p 8080:8080 --name "jenkins" --volumes-from jenkinsdata -v /etc/localtime :/etc/localtime:ro -v /etc/sysconfig/clock:/etc/sysconfig/clock :ro codingtony/jenkins
2727```
2828
2929If you need to setup stuff in /opt/jenkins/data, you probably want to log to the image and update the configuration you will simply to this :
3030
3131```
32- docker run --rm -ti -p 8080:8080 --volumes-from jenkinsdata codingtony/jenkins bash
32+ docker run --rm -ti -p 8080:8080 --volumes-from jenkinsdata -v /etc/localtime:/etc/localtime:ro -v /etc/sysconfig/clock:/etc/sysconfig/clock:ro codingtony/jenkins bash
3333```
3434
3535
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ sed ' s/ZONE.*="\(.*\)"$/\1/g' /etc/sysconfig/clock > /etc/timezone
3+ /usr/bin/java -jar /opt/jenkins/jenkins.war
4+
You can’t perform that action at this time.
0 commit comments