Creating Tomcat image of dockerfile


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


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


CMD user/local/apache-tomcat-9.0.22/bin/ && 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 = […]