Dockerfile-build 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # FROM openjdk:11 as builder
  2. FROM openjdk:8 as builder
  3. ARG MAVEN_VERSION=3.9.5 \
  4. GRADLE_VERSION=7.3.3
  5. ARG GRADLE_DOWNLOAD_SHA256=98bd5fd2b30e070517e03c51cbb32beee3e2ee1a84003a5a5d748996d4b1b915
  6. # # install gradle
  7. RUN set -o errexit -o nounset \
  8. && echo "Downloading Gradle" \
  9. && wget -q "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -P /tmp/gradle.zip \
  10. \
  11. && echo "Checking download hash" \
  12. && echo "${GRADLE_DOWNLOAD_SHA256} *gradle.zip" | sha256sum -c - \
  13. \
  14. && echo "Installing Gradle" \
  15. && unzip -d /opt/gradle /tmp/gradle-*.zip && rm -rf /tmp/gradle-*.zip \
  16. && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle
  17. ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION}
  18. ENV PATH=$PATH:$GRADLE_HOME/bin
  19. # install maven
  20. RUN set -o errexit -o nounset \
  21. && echo "Downloading Maven" \
  22. && wget -q "https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip" -P /tmp \
  23. \
  24. && echo "Installing Maven" \
  25. && unzip -d /opt/maven /tmp/apache-maven-*.zip && rm -rf /tmp/apache-maven-*.zip \
  26. && ln -s "${MAVEN_HOME}/bin/mvn" /usr/bin/mvn
  27. ENV MAVEN_HOME=/opt/maven/apache-maven-${MAVEN_VERSION}
  28. ENV PATH=$PATH:$MAVEN_HOME/bin
  29. LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
  30. WORKDIR /workspaces
  31. # RUN mvn package
  32. VOLUME [ "/workspaces" ]
  33. ENV USER_HOME_DIR="/home/gradle"
  34. ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
  35. CMD [ "/bin/bash" ]