Skip to content

Commit

Permalink
Add source code label to Dockerfile to link to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
zachauten committed Sep 24, 2024
1 parent bb42fec commit 4181b81
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# docker build -t spring-app .
# docker run --name spring-app -d -p 8080:8080 spring-app

# docker run --name spring-boilerplate -d -p 8080:8080 spring-boilerplate
FROM maven:3.9.8-eclipse-temurin-21 as build

COPY pom.xml .
RUN --mount=type=cache,target=/root/.m2,rw mvn -B dependency:go-offline
COPY src src
RUN --mount=type=cache,target=/root/.m2,rw mvn -B package

FROM eclipse-temurin:21
FROM eclipse-temurin:21-jammy

WORKDIR /app
COPY --from=build target/*.jar ./app.jar
Expand All @@ -26,3 +24,5 @@ ENTRYPOINT ["java", "-javaagent:/app/opentelemetry-javaagent.jar", "-jar", "app.
EXPOSE 8080
HEALTHCHECK CMD curl -f http://0.0.0.0:8080/health || exit 1

# https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package#connecting-a-repository-to-a-container-image-using-the-command-line
LABEL org.opencontainers.image.source=https://github.com/zachauten/spring-boilerplate

0 comments on commit 4181b81

Please sign in to comment.