-
Notifications
You must be signed in to change notification settings - Fork 422
/
Copy pathDockerfile
41 lines (33 loc) · 1.96 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Update EXTRA_TAG_SUFFIXES to new release when changing to next stable debian release
# EXTRA_TAG_SUFFIXES=bookworm
FROM debian:bookworm-slim
# install corretto after verifying that the key is the one we expect.
# and keep openssh client
RUN apt-get update \
&& apt-get install -y curl gnupg openssh-client \
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fL https://apt.corretto.aws/corretto.key | gpg --batch --import \
&& gpg --batch --export '6DC3636DAE534049C8B94623A122542AB04F24E3' > /usr/share/keyrings/corretto.gpg \
&& unset GNUPGHOME \
&& echo "deb [signed-by=/usr/share/keyrings/corretto.gpg] https://apt.corretto.aws stable main" > /etc/apt/sources.list.d/corretto.list \
&& apt-get update \
&& apt-get remove --purge --autoremove -y curl gnupg \
&& apt-get install -y java-11-amazon-corretto-jdk \
&& rm -rf /var/lib/apt/lists/*
# set JAVA_HOME manually since nothing else will set it
ENV JAVA_HOME="/usr/lib/jvm/java-11-amazon-corretto"
# common for all images
LABEL org.opencontainers.image.title="Apache Maven"
LABEL org.opencontainers.image.source=https://github.com/carlossg/docker-maven
LABEL org.opencontainers.image.url=https://github.com/carlossg/docker-maven
LABEL org.opencontainers.image.description="Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information."
ENV MAVEN_HOME=/usr/share/maven
COPY --from=maven:3.9.9-eclipse-temurin-17 ${MAVEN_HOME} ${MAVEN_HOME}
COPY --from=maven:3.9.9-eclipse-temurin-17 /usr/local/bin/mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
COPY --from=maven:3.9.9-eclipse-temurin-17 /usr/share/maven/ref/settings-docker.xml /usr/share/maven/ref/settings-docker.xml
RUN ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn
ARG MAVEN_VERSION=3.9.9
ARG USER_HOME_DIR="/root"
ENV MAVEN_CONFIG="$USER_HOME_DIR/.m2"
ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"]
CMD ["mvn"]