自定义centos镜像(要指定版本),tomcat镜像docker
centos docker镜像
现在直接用
FROM centos
MAINTAINER xwhking<2837468248@qq.com>
RUN yum -y install vim
RUN yum -y install net-utils
这个运行已经会出错了
出错如下
要进行版本指定
FROM centos:7
MAINTAINER xwhking<2837468248@qq.com>
RUN yum -y install vim
RUN yum -y install net-utils
tomcat 镜像
首先下载tomcat和jdk 的tar包
注意把安装包放在同一个目录下,这样子才能找到
FROM centos:7
MAINTAINER xwhking<2837468248@qq.com>
ADD jdk-8u171-linux-x64.tar.gz /usr/local/ # 压缩包的地址
ADD apache-tomcat-9.0.80.tar.gz /usr/local/ # 压缩包的地址
RUN yum -y install vim
RUN yum -y install iproute
RUN yum -y install net-tools
ENV MYPATH /usr/local
WORKDIR $MYPATH
# 配置jdk和tomcat环境
ENV JAVA_HOME /usr/local/jdk1.8.0_171
ENV CATALINA_HOME /usr/local/apache-tomcat-9.0.80
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin
#容器运行时监听的端口
EXPOSE 8080
# 启动时运行tomcat
CMD /usr/local/apache-tomcat-9.0.80/bin/startup.sh && tail -F /usr/local/apache-tomcat-9.0.80/bin/logs/catalina.out