Skip to content

Commit 03c240b

Browse files
committed
fix: docker image requires static compile + certificates
1 parent 6761b85 commit 03c240b

2 files changed

Lines changed: 7 additions & 18 deletions

File tree

.github/workflows/docker.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ jobs:
4848
java-version: '17'
4949
cache: 'gradle'
5050
- name: Build native
51-
run: ./gradlew build --no-daemon -Dquarkus.package.type=native
51+
run: ./gradlew build --no-daemon
52+
-Dquarkus.package.type=native
53+
-Dquarkus.native.additional-build-args="--static --libc=musl"
5254
- name: Log in to the Container registry
5355
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
5456
with:

src/main/docker/Dockerfile.native

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1-
####
2-
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
3-
#
4-
# Before building the container image run:
5-
#
6-
# ./gradlew build -Dquarkus.package.type=native
7-
#
8-
# Then, build the image with:
9-
#
10-
# docker build -f src/main/docker/Dockerfile.native -t quarkus/qualityannotate .
11-
#
12-
# Then run the container using:
13-
#
14-
# docker run -i --rm -p 8080:8080 quarkus/qualityannotate
15-
#
16-
###
1+
FROM alpine:3 as certs
2+
RUN apk --update add ca-certificates
3+
174
FROM scratch
185
WORKDIR /
6+
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
197
COPY --chown=1001:root build/resources/main/application.yml /config/application.yml
208
COPY --chown=1001:root build/*-runner /qualityannotate
219

22-
EXPOSE 8080
2310
USER 1001
2411

2512
ENTRYPOINT ["/qualityannotate"]

0 commit comments

Comments
 (0)