add Dockerfile

This commit is contained in:
Gregor Zeitlinger 2023-11-23 16:54:23 +01:00
parent 923e2b7aa3
commit 985da57f12

22
Dockerfile Normal file
View file

@ -0,0 +1,22 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# build: docker build -t petclinic .
# run: docker run -p 8080:8080 petclinic
FROM gradle:8-jdk17 AS builder
WORKDIR /usr/src/app/
COPY ./ ./
RUN gradle bootJar
# -----------------------------------------------------------------------------
FROM gcr.io/distroless/java17-debian11
WORKDIR /usr/src/app/
COPY --from=builder /usr/src/app/build/libs/spring-petclinic-*.jar ./spring-petclinic.jar
ENTRYPOINT [ "java", "-jar", "spring-petclinic.jar" ]