由于disconf的环境比较复杂,不适合使用dockerfile的方式进行创建,我们使用commit的方式进行创建。
export PATH=/usr/local/bin:$PATH;
export JDK_HOME=/usr/local/xxx/jdk1.7.0_75
export JAVA_HOME=$JDK_HOME
export JRE_HOME=$JDK_HOME/jre
export CLASSPATH=$CLASSPATH:.:$JDK_HOME/lib:$JDK_HOME/jre/lib
export PATH=$JDK_HOME/bin:$PATH;
source /etc/profile
java -version就可以看到java的版本
该jdk镜像需要经常使用,所以提交一个版本到本地私有仓库,方便以后使用
sudo docker commit -m 'add the jdk_1.7.0_75' -a 'jthink' fba497eecca1 ip:5000/ubuntu:14.04-jdk_1.7.0_75
sudo docker push ip:5000/ubuntu:14.04-jdk_1.7.0_75
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/soft/zookeeper/data/zoo2
dataLogDir=/home/soft/zookeeper/log/zoo2
clientPort=2182
server.1=localhost:2287:3387
server.2=localhost:2288:3388
server.3=localhost:2289:3389
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/soft/zookeeper/data/zoo3
dataLogDir=/home/soft/zookeeper/log/zoo3
clientPort=2183
server.1=localhost:2287:3387
server.2=localhost:2288:3388
server.3=localhost:2289:3389
然后进bin启动,./zkServer.sh start
export M2_HOME=/home/soft/apache-maven-3.0.5
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
FROM ip:5000/ubuntu:14.04-disconf
MAINTAINER jthink qianjc@unionpaysmart.com
COPY settings.xml /home/soft/apache-maven-3.0.5/conf
COPY redis2.conf /home
COPY ./conf/application.properties /usr/local/xxx/disconf/source
COPY ./conf/jdbc-mysql.properties /usr/local/xxx/disconf/source
COPY ./conf/log4j.properties /usr/local/xxx/disconf/source
COPY ./conf/logback.xml /usr/local/xxx/disconf/source
COPY ./conf/rabbit.properties /usr/local/xxx/disconf/source
COPY ./conf/redis-config.properties /usr/local/xxx/disconf/source
COPY ./conf/zoo.properties /usr/local/xxx/disconf/source
COPY ./src/disconf /home/src
COPY run.sh /run.sh
EXPOSE 8991
CMD ["/run.sh"]
cd /home/src/disconf-web
source /etc/profile
sh deploy/deploy.sh
/usr/bin/redis-server /etc/redis/redis.conf
/usr/bin/redis-server /home/redis2.conf
bash /home/soft/zookeeper/zookeeper-3.4.6_1/bin/zkServer.sh start
bash /home/soft/zookeeper/zookeeper-3.4.6_2/bin/zkServer.sh start
bash /home/soft/zookeeper/zookeeper-3.4.6_3/bin/zkServer.sh start
bash /home/soft/apache-tomcat-7.0.67/bin/startup.sh
service nginx start
/usr/sbin/sshd -D
构建和启动
sudo docker build -t ip:5000/ubuntu:14.04-disconf-r /home/xxx/xxx/docker/images/disconf
sudo docker run -d -p 8991:8991 --name disconf-r ip:5000/ubuntu:14.04-disconf-r bash /run.sh
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://jthink.blog.csdn.net/article/details/50673561
内容来源于网络,如有侵权,请联系作者删除!