-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-git
52 lines (37 loc) · 1.75 KB
/
Dockerfile-git
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Create image from git
# java , jre -> : gradle , eclipse-temurin ,amazoncorretto , ibm-semeru-runtimes !!!
# syntax=docker/dockerfile:1
FROM gradle:jdk21 AS build
ARG ORG_GRADLE_PROJECT_isProduction="yes"
ENV ORG_GRADLE_PROJECT_isProduction=$ORG_GRADLE_PROJECT_isProduction
WORKDIR /app
COPY --chown=gradle:gradle --from=project . /app
RUN gradle installDist
FROM eclipse-temurin:22.0.1_8-jdk-alpine as my-jdk
# required for strip-debug to work
RUN apk add --no-cache binutils
# Build small JRE image
RUN $JAVA_HOME/bin/jlink \
--verbose \
--add-modules java.base,jdk.crypto.ec,java.management,java.naming,java.net.http,java.security.jgss,java.security.sasl,java.sql,jdk.httpserver,jdk.unsupported \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /customjre
FROM alpine:latest
ENV JAVA_HOME=/jre
ENV PATH="${JAVA_HOME}/bin:${PATH}"
COPY --from=my-jdk /customjre $JAVA_HOME
COPY --from=build --chmod=777 /app/build/install/query-gra /app/
WORKDIR /app/bin
EXPOSE 9090
CMD ["./query-gra"]
# sudo docker buildx build -f ./Dockerfile-git --build-arg ORG_GRADLE_PROJECT_isProduction=yes --build-context project=https://[email protected]/borisgra/fullWeb.git --progress=plain -t borisgra/query-gra:latest . 2>&1 | tee build.log
# sudo docker buildx build -f ./Dockerfile-git --build-arg ORG_GRADLE_PROJECT_isProduction=yes --build-context project=https://borisgra:[email protected]/borisgra/jvm-js-fullstack.git --progress=plain -t borisgra/query-gra:latest . 2>&1 | tee build.log
# sudo docker login -u borisgra
# sudo docker push borisgra/query-gra:latest
# sudo docker pull borisgra/query-gra:latest
# sudo docker run borisgra/query-gra:latest -p 5004:5004
#docker builder prune # clear cache
#--no-cache