Created
September 15, 2021 08:32
-
-
Save bbalakriz/b551df675568f5ef03d88c3ae29f62b3 to your computer and use it in GitHub Desktop.
sample-custom-kie-server.Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # This Dockerfile is divided in two stages, the first is a builder for the KJAR | |
| # and the second is the executable image (KIE Server + KJAR). | |
| # dependency:go-offline does not resolve transitive BOM (from drools-bom), therefore '--offline' does not work. | |
| ### BUILDER IMAGE ### | |
| FROM docker.io/maven:3.8.1-jdk-11-slim as builder | |
| ARG MVN="mvn --show-version --batch-mode" | |
| ### Choose to build the dependencies or let them resolve from Maven Central. | |
| ### rhpam-dependencies | |
| # COPY rhpam-dependencies/pom.xml /build/rhpam-dependencies/ | |
| # RUN $MVN --file build/rhpam-dependencies/pom.xml install | |
| ### rhpam-event-listener | |
| # COPY rhpam-event-listener/pom.xml /build/rhpam-event-listener/ | |
| # RUN $MVN --file build/rhpam-event-listener/pom.xml dependency:go-offline | |
| # COPY rhpam-event-listener/src /build/rhpam-event-listener/src/ | |
| # RUN $MVN --file build/rhpam-event-listener/pom.xml install | |
| ### rhpam-kjar | |
| COPY rhpam-kjar/pom.xml /build/rhpam-kjar/ | |
| RUN $MVN --file build/rhpam-kjar/pom.xml dependency:go-offline | |
| COPY rhpam-kjar/src /build/rhpam-kjar/src/ | |
| RUN $MVN --file build/rhpam-kjar/pom.xml install | |
| ### EXECUTABLE IMAGE ### | |
| FROM registry.redhat.io/rhpam-7/rhpam-kieserver-rhel8:7.11.1 | |
| ARG CREATED_AT=none | |
| ARG GITHUB_SHA=none | |
| LABEL org.opencontainers.image.created="$CREATED_AT" | |
| LABEL org.opencontainers.image.revision="$GITHUB_SHA" | |
| LABEL org.opencontainers.image.licenses="MIT" | |
| LABEL org.opencontainers.image.version="1.1.0" | |
| COPY --from=builder /root/.m2/repository /home/jboss/.m2/repository/ | |
| USER root | |
| RUN chown jboss -R /home/jboss/.m2/repository | |
| USER jboss | |
| ENV KIE_SERVER_CONTAINER_DEPLOYMENT=rhpam-sample=com.sample:rhpam-kjar:1.0.0-SNAPSHOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment