Home > other >  Dockerfile create tomcat image problem
Dockerfile create tomcat image problem

Time:10-23

The FROM docker. IO/centos
MAINTAINER ZHANG
RUN the mkdir -p/usr/local/dkfilepath/soft
RUN the mkdir -p/usr/local/dkfilepath/soft/JDK
RUN the mkdir -p/usr/local/dkfilepath/soft/tomcat
The ADD jdk1.8.0 _211/usr/local/dkfilepath/soft/JDK
The ADD apache tomcat - 8.5.41/usr/local/dkfilepath/soft/tomcat
ENV JAVA_HOME/usr/local/dkfilepath/soft/JKD
ENV JAVA_HOME $the CATALINA_HOME/usr/local/dkfilepath/soft/tomcat
ENV PATH $PATH: $JAVA_HOME/bin: $the CATALINA_HOME/bin
EXPOSE 8080
CMD ["/usr/local/dkfilepath/soft/tomcat/bin/catalina. Sh ", "run"]


My dockerfile as above, create a tomcat image, but the RUN mkdir time always can't create the corresponding directory
As a result, create a container times
/usr/local/dkfilepath/soft/tomcat/bin/Java: No to the file or directory/usr/local/dkfilepath/soft/tomcat/bin/Java: No to the file or directory

O you teach

CodePudding user response:

You to create the directory is wrong, you put the ADD apache tomcat - 8.5.41/usr/local/dkfilepath/soft/tomcat this, then a layer of more directory, so the error/usr/local/dkfilepath/soft/tomcat/bin/Java does not exist,

CodePudding user response:

Can you take a photo, so not intuitive

CodePudding user response:

You this is not build directory, you this is the time to do the environment variable error, ENV JAVA_HOME/usr/local/dkfilepath/soft/JKD

Build a layered image, can according to the id to check the log
  • Related