Skip to content

Commit

Permalink
Fix Docker Build
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-pona authored Jan 11, 2023
1 parent df4117f commit f75a4cb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions solution/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
FROM registry.access.redhat.com/ubi8/openjdk-17 AS build
COPY --chown=jboss:jboss / /usr/local/src/prometheus-training-spring-boot-example
RUN cd /usr/local/src/prometheus-training-spring-boot-example && ./mvnw clean package
RUN curl -L https://github.com/prometheus/prometheus/releases/download/v2.41.0/prometheus-2.41.0.linux-amd64.tar.gz \
--output /tmp/prometheus-2.41.0.linux-amd64.tar.gz && tar xzf /tmp/prometheus-2.41.0.linux-amd64.tar.gz -C /home/jboss prometheus-2.41.0.linux-amd64/promtool
RUN find /home/jboss

# Package stage
FROM registry.access.redhat.com/ubi8/openjdk-17
COPY --from=build /usr/local/src/prometheus-training-spring-boot-example/target/prometheus-training-spring-boot-example-0.0.1-SNAPSHOT.jar /usr/local/bin/prometheus-training-spring-boot-example.jar
COPY --from=build /home/jboss/prometheus-2.41.0.linux-amd64/promtool /usr/local/bin/promtool
RUN chgrp -R 0 /usr/local/bin/prometheus-training-spring-boot-example.jar /usr/local/bin/promtool && \
chmod -R g+rwX /usr/local/bin/prometheus-training-spring-boot-example.jar /usr/local/bin/promtool
RUN chgrp -R 0 /usr/local/bin/prometheus-training-spring-boot-example.jar && \
chmod -R g+rwX /usr/local/bin/prometheus-training-spring-boot-example.jar
ENTRYPOINT ["java","-jar","/usr/local/bin/prometheus-training-spring-boot-example.jar"]
EXPOSE 8080/tcp

0 comments on commit f75a4cb

Please sign in to comment.