Skip to content

Commit

Permalink
ci: build inside a builder container (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrehu authored Oct 10, 2023
1 parent 88b379a commit bf69b60
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- run: mvn --batch-mode --update-snapshots verify
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- run: mvn --batch-mode --update-snapshots verify
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/metadata-action@v5
Expand Down
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM maven:3-eclipse-temurin-17 AS builder
WORKDIR /workspace
COPY pom.xml pom.xml
RUN mvn dependency:resolve
COPY src/ src/
RUN mvn --batch-mode verify

FROM eclipse-temurin:17.0.8_7-jre-alpine
WORKDIR /app
COPY target/k3a-lag-exporter-jar-with-dependencies.jar ./k3a-lag-exporter.jar
COPY --from=builder /workspace/target/k3a-lag-exporter-jar-with-dependencies.jar ./k3a-lag-exporter.jar

ENTRYPOINT ["java", "-Dconfig.file=k3a-lag-exporter.conf", "-jar", "k3a-lag-exporter.jar"]

0 comments on commit bf69b60

Please sign in to comment.