search

Home  >  Q&A  >  body text

linux - docker creates image file

As a newbie, I tried to use docker as a container. I just compiled and installed apr and loaded it into tomcat, but it didn't work. It keeps reporting that libtool cannot be found. The following is my script

ROM         centos:6.6
MAINTAINER    linx

#安装arp
#安装autoconf libtool openssl
RUN yum -y install autoconf automake  libtool openssl openssl-devel
RUN autoreconf --force --install
RUN libtoolize --automake --force
RUN automake --force --add-missing
ADD apr-1.5.2.tar.gz /usr/local/
RUN mkdir /usr/apr
RUN /usr/local/apr-1.5.2/configure --prefix=/usr/apr
WORKDIR /usr/local/apr-1.5.2/
RUN pwd
RUN make
RUN make install

#把java与tomcat添加到容器中
ADD jdk_1.7.0_79.tar.gz /usr/local/
ADD apache-tomcat-7.0.67.tar.gz /usr/local/

#安装配置tomcat-native
ADD tomcat-native.tar.gz /usr/local/tomcat-native/
WORKDIR /usr/local/tomcat-native/tomcat-native-1.1.33-src/jni/native/
RUN ./configure --with-apr=/usr/apr --with-java-home=/usr/local/java --with-ssl=/usr/bin
RUN make && make install

#配置java与tomcat环境变量 apr
ENV JAVA_HOME /usr/local/java
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV CATALINA_HOME /usr/local/apache-tomcat-7.0.67
ENV CATALINA_BASE /usr/local/apache-tomcat-7.0.67
#容器运行时监听的端口
EXPOSE  8080
CMD ["catalina.sh", "run"]
求大神指教
phpcn_u1582phpcn_u15822751 days ago620

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:19:26

    It is recommended to run an interactive container first and execute the compilation and installation process step by step. If you can’t pass the manual execution process, how can you successfully generate an image directly?

    reply
    0
  • Cancelreply