在 https://my.oschina.net/ytqvip/blog/1595054文章的sun jdk 8镜像基础上构建maven 3的docker镜像,Dockerfile内容如下:
FROM myimage/alpine_glibc_jdk:8
MAINTAINER tongqiang<tongqiangying@gmail.com>
ENV MAVEN_VERSION 3.5.2
ENV MAVEN_HOME /usr/local/maven/default-maven
ENV MAVEN_DOWNLOAD_URL http://mirror.bit.edu.cn/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
RUN apk add --no-cache bash tar wget ca-certificates unzip
&& mkdir -p ${MAVEN_HOME}
&& wget ${MAVEN_DOWNLOAD_URL}
&& tar -zxf apache-maven-${MAVEN_VERSION}-bin.tar.gz -C ${MAVEN_HOME} --strip-components=1
&& ln -s ${MAVEN_HOME}/bin/mvn /usr/local/bin/mvn
&& apk del tar wget ca-certificates unzip
&& rm -rf apache-maven-${MAVEN_VERSION}-bin.tar.gz
${MAVEN_HOME}/bin/*.bat
/tmp/*
CMD ["bash"]
构建maven镜像
docker build -t myimage/alpine-sunjdk8-maven:3 .
转载于:https://my.oschina.net/ytqvip/blog/1595062