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 b79cca7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
with:
Expand Down
7 changes: 2 additions & 5 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 @@ -25,4 +23,3 @@ ENTRYPOINT ["java", "-javaagent:/app/opentelemetry-javaagent.jar", "-jar", "app.

EXPOSE 8080
HEALTHCHECK CMD curl -f http://0.0.0.0:8080/health || exit 1

0 comments on commit b79cca7

Please sign in to comment.