Docker web平台基础镜像

Docker web平台 PHP、Java、ASP.NET 基础镜像。

基础镜像基于CentOS7,通过Dockerfile来构建,直接上内容


一、httpd php平台镜像

FROM centos

MAINTAINER Billy Zhang “xxx@xxx.com”

RUN yum -y install httpd

RUN yum -y install epel-release

RUN rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

RUN yum -y install php56w php56w-mysql php56w-gd php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mbstring php56w-bcmath libjpeg* mhash mhash-devel mcrypt

# 测试文件,放构建目录下,内容自定

COPY phpinfo.php /var/www/html/

EXPOSE 80

ENTRYPOINT [“/usr/sbin/httpd”]

CMD [“-D”, “FOREGROUND”]


二、tomcat8 JSP平台镜像

FROM centos

MAINTAINER Billy Zhang “xxx@xxx.com”

WORKDIR /root/

# JDK包,下载后放在构建目录,名称对应作修改

COPY jdk-8u151-linux-x64.rpm /root/

RUN rpm -Uvh jdk-8u151-linux-x64.rpm

RUN rm -f jdk*.rpm

# Tomcat包,下载后放在构建目录,名称对应作修改

ADD apache-tomcat-8.0.48.tar.gz /usr/share/

RUN mv /usr/share/apache-tomcat-8.0.48 /usr/share/tomcat8

RUN rm -f apache*.tar.gz

EXPOSE 8080

ENTRYPOINT [“/usr/share/tomcat8/bin/catalina.sh”, “run”]


三、httpd+Mono ASP.NET平台镜像

FROM centos

MAINTAINER Billy Zhang “xxx@xxx.com”

RUN yum -y install httpd

RUN yum install yum-utils

RUN rpm –import “http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF”

RUN yum-config-manager –add-repo http://download.mono-project.com/repo/centos7/

RUN yum -y install mono-complete

RUN yum -y install xsp

RUN yum -y install mod_mono

RUN echo “MonoServerPath /usr/bin/mod-mono-server4” >> /etc/httpd/conf.d/mod_mono.conf

# 测试文件,放构建目录下,内容自定

COPY default.aspx /var/www/html/

EXPOSE 80

ENTRYPOINT [“/usr/sbin/httpd”]

CMD [“-D”, “FOREGROUND”]

文章出处:JPCode.net 精品代码网
链接:http://www.jpcode.net/article/10013

评论: