Maven / Gradle in docker

    0

    0

    Vinod Pahuja

    Swiss Army Knife
    - maven
      https://hub.docker.com/_/maven
    
      # Build stage
      FROM maven:3-jdk-8-slim AS build
      COPY src /home/app/src
      COPY pom.xml /home/app
      RUN mvn -f /home/app/pom.xml clean package
    
      # Package stage
      FROM openjdk:8-jre-slim
      COPY --from=build /home/app/target/demo-0.0.1-SNAPSHOT.jar /usr/local/lib/demo.jar
      EXPOSE 8080
      ENTRYPOINT ["java","-jar","/usr/local/lib/demo.jar"]
      
      docker run --rm -it
    
      - gradle
      
      gradle --stop 
      gradle run --no-daemon
      
      https://hub.docker.com/_/gradle
      
      FROM gradle:jdk8-alpine
      COPY app /home/gradle/project
      WORKDIR /home/gradle/project
      RUN gradle run --no-daemon
      
    
      docker run --rm -it -v ~/.gradle:/home/gradle/.gradle firestore-demo
      docker run --rm -it -v ~/.gradle:/home/gradle/.gradle firestore-demo gradle run --no-daemon
    
      ----
    
      docker run --rm -it -v ~/.gradle:/home/gradle/.gradle -v "$PWD":/home/gradle/project -w /home/gradle/project gradle:jdk8-alpine gradle run --no-daemon
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.