您好,登錄后才能下訂單哦!
本篇內容主要講解“怎么在sun jdk 8鏡像基礎上構建tomcat 8 docker鏡像 ”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“怎么在sun jdk 8鏡像基礎上構建tomcat 8 docker鏡像 ”吧!
FROM myimage/alpine_glibc_jdk:8 MAINTAINER tongqiang<tongqiangyin@gmail.com> ENV TOMCAT_MAJOR 8 ENV TOMCAT_VERSION 8.5.23 ENV CATALINA_HOME /usr/local/tomcat ENV PATH $CATALINA_HOME/bin:$PATH ENV TOMCAT_NATIVE_LIBDIR $CATALINA_HOME/native-jni-lib ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOMCAT_NATIVE_LIBDIR ENV TOMCAT_TGZ_URL http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-${TOMCAT_MAJOR}/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz RUN apk add --no-cache --virtual .build-deps \ ca-certificates \ tar \ wget \ openssl \ openssl-dev \ apr-dev \ coreutils \ dpkg-dev dpkg \ gcc \ libc-dev \ make \ && mkdir -p ${CATALINA_HOME} \ && wget -O tomcat.tar.gz ${TOMCAT_TGZ_URL} \ && tar -xvf tomcat.tar.gz -C ${CATALINA_HOME} --strip-components=1 \ && nativeBuildDir=$(mktemp -d) \ && tar -xvf ${CATALINA_HOME}/bin/tomcat-native.tar.gz -C ${nativeBuildDir} --strip-components=1 \ && ( cd ${nativeBuildDir}/native \ && gnuArch=$(dpkg-architecture --query DEB_BUILD_GNU_TYPE) \ && ./configure \ --build=${gnuArch} \ --libdir=${TOMCAT_NATIVE_LIBDIR} \ --prefix=${CATALINA_HOME} \ --with-apr=$(which apr-1-config) \ --with-java-home=${JAVA_HOME} \ --with-ssl=yes \ && make -j $(nproc) \ && make install) \ && runDeps=$( \ scanelf --needed --nobanner --recursive ${TOMCAT_NATIVE_LIBDIR} \ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | sort -u \ | xargs -r apk info --installed \ | sort -u \ ) \ && apk add --virtual .tomcat-native-rundeps ${runDeps} \ && nativeLines=$(catalina.sh configtest 2>&1) \ && nativeLines=$(echo ${nativeLines} | grep 'Apache Tomcat Native') \ && nativeLines=$(echo ${nativeLines} | sort -u) \ && if ! echo ${nativeLines} | grep 'INFO: Loaded APR based Apache Tomcat Native library' >&2; then \ echo >&2 ${nativeLines}; \ exit 1; \ fi \ && apk del .build-deps \ && rm -rf ${CATALINA_HOME}/bin/*.bat \ ${CATALINA_HOME}/bin/tomcat-native.tar.gz \ ${CATALINA_HOME}/webapps/* \ tomcat.tar.gz EXPOSE 8080 CMD ["catalina.sh", "run"]
構建命令如下:
docker build -t alpine-sunjdk8-tomcat:8 .
到此,相信大家對“怎么在sun jdk 8鏡像基礎上構建tomcat 8 docker鏡像 ”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。