Creating Tomcat image of dockerfile

Time:2020-9-23

Steps to install Tomcat image

  1. Prepare image file

    Tomcat package JDK package
    Put it in the same folder as dockfile
    There’s no file here. It’s everywhere

  2. Write dockerfile
VIM dockerfile ා officially recommended name

#Type the following command in the VIM text edit box

FROM centos
MAINTAINER Yang<[email protected]>

COPY /user/local/myInfo.txt /user/local/myInfo.txt

ADD jdk-8ull-linux-x64.tar.gz /user/local/
ADD apache-tomcat-9.0.22.tar.gz /usr/loacl/

RUN yum -y install vim

ENV MYPATH /user/local

WORKPATH $MYPATH

ENV JAVA_HOME /user/local/jdk1.8.0_11
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV CATALINA_HOME /user/local/apache-tomcat-9.0.22
ENV CATALINA_BASH /user/local/apache-tomcat-9.0.22
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME

EXPOSE 8080

CMD user/local/apache-tomcat-9.0.22/bin/startup.sh && tail -F /url/local/apache-tomcat-9.0.22/bin/logs/catalina.out
  1. docker build Dockerfile -t mytomcat:0.1 . #This point is the soul. It can’t be done without it

Recommended Today

[rust] basic data type

This article introduces the built-in data types provided by rust. Boolean type Boolean typeLogical values representing yes and No. It has two values:trueandfalseGenerally used in logical expressions, and, or, and not operations can be performed: fn main() { let x = true; let y: bool = ! x; // False, inverse operation let z = […]