Skip to content

Commit 897076c

Browse files
authored
build: reducing docker image size (#36)
1 parent 7ee2370 commit 897076c

File tree

3 files changed

+21
-33
lines changed

3 files changed

+21
-33
lines changed

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
4747
with:
4848
context: .
49-
file: ./Dockerfile.build
49+
file: ./Dockerfile
5050
push: true
5151
tags: ${{ steps.meta.outputs.tags }}
5252
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM gradle:8.7.0-jdk21-alpine AS build
2+
3+
ARG GRADLE_OPTS
4+
5+
RUN apk add --no-cache protoc unzip
6+
7+
COPY --chown=gradle:gradle . /usr/src/cirrina
8+
WORKDIR /usr/src/cirrina
9+
10+
RUN gradle distZip
11+
12+
# Unpack distribution and normalize path
13+
RUN unzip build/distributions/cirrina.zip -d /tmp \
14+
&& chmod +x /tmp/cirrina/bin/cirrina
15+
16+
FROM gcr.io/distroless/java21-debian12 AS runtime
17+
18+
COPY --from=build /tmp/cirrina /opt/cirrina
19+
20+
ENTRYPOINT ["java", "-cp", "/opt/cirrina/lib/*", "at.ac.uibk.dps.cirrina.cirrina.Cirrina"]

Dockerfile.build

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)