Skip to content

Commit

Permalink
fix: docker image requires static compile + certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
balrok committed Nov 1, 2023
1 parent 6761b85 commit 03c240b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
java-version: '17'
cache: 'gradle'
- name: Build native
run: ./gradlew build --no-daemon -Dquarkus.package.type=native
run: ./gradlew build --no-daemon
-Dquarkus.package.type=native
-Dquarkus.native.additional-build-args="--static --libc=musl"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
Expand Down
21 changes: 4 additions & 17 deletions src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
#
# Before building the container image run:
#
# ./gradlew build -Dquarkus.package.type=native
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native -t quarkus/qualityannotate .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/qualityannotate
#
###
FROM alpine:3 as certs
RUN apk --update add ca-certificates

FROM scratch
WORKDIR /
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --chown=1001:root build/resources/main/application.yml /config/application.yml
COPY --chown=1001:root build/*-runner /qualityannotate

EXPOSE 8080
USER 1001

ENTRYPOINT ["/qualityannotate"]

0 comments on commit 03c240b

Please sign in to comment.