A basic docker image for building maven project.
1.3K
A basic docker image for building maven project.
java and mvn/opt/apache-maven-repository-cn, its apt repository and maven mirror has been changed to Aliyun.latestCurrently the latest image is same with maven3.8.6-openjdk11-cn, apt repository and maven mirror has been changed to Aliyun.
Here is a sample:
# latest image uses openjdk 11.0.13.1+8 and maven 3.8.4
FROM ayakurayuki/java-maven-builder:latest as build
USER root
RUN mkdir -p /opt/code
WORKDIR /opt/code
# copy all the project files into /opt/code in image, the pom.xml file should be places to /opt/code/pom.xml
COPY . ./
# any build command you want can be write here
RUN mvn compile install package
# build runnable image
FROM openjdk:11.0.9
RUN mkdir -p /data/package
COPY --from=build /opt/code/module/target/product-fat-1.0.jar /data/package/product.jar
Content type
Image
Digest
sha256:bc9254bce…
Size
248.3 MB
Last updated
almost 4 years ago
docker pull ayakurayuki/java-maven-builder