docker_tomcat_jdk 7.0 1.6 app admin && api
1、yum install docker
2、service docker start
3、创建文件夹放入jdkforlinux.tar.gz && tomcatforlinux.tar.gz
4、DockerFile
#pull down centos image
FROM centos
#copy jdk and tomcat into image
ADD ./apache-tomcat-7.0.73.tar.gz /root
ADD ./jdk-6u45-linux-x64.tar.gz /root
#set environment variable
ENV JAVA_HOME /root/jdk1.6.0_45
ENV PATH $JAVA_HOME/bin:$PATH
#define entry point which will be run first when the container starts up
ENTRYPOINT /root/apache-tomcat-7.0.73/bin/startup.sh && tail -F /root/apache-tomcat-7.0.73/logs/catalina.out
5、docker build -t keven/centos:tomcat-centos --rm=true .
6、docker images keven/centos
7、docker run -d -p 8881:8881 3216(id)
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:利用docker 部署项目 - Python技术站