-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-git
62 lines (48 loc) · 2.09 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
52
53
54
55
56
57
58
59
60
61
62
# Create image from git src
# syntax=docker/dockerfile:1
FROM gradle:jdk23 AS build
RUN apt-get update && apt-get install -y \
ca-certificates \
curl
# install nodejs - https://stackoverflow.com/questions/36399848/install-node-in-dockerfile
ARG NODE_VERSION=22.0.0
ARG NODE_PACKAGE=node-v$NODE_VERSION-linux-x64
ARG NODE_HOME=/opt/$NODE_PACKAGE
ENV NODE_PATH $NODE_HOME/lib/node_modules
ENV PATH $NODE_HOME/bin:$PATH
RUN curl https://nodejs.org/dist/v$NODE_VERSION/$NODE_PACKAGE.tar.gz | tar -xzC /opt/
RUN echo "NODE Version:" && node --version
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:23-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,java.sql,java.management,java.naming,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://borisgra@github.com/borisgra/fullWeb.git --progress=plain -t borisgra/query-gra:w1 . 2>&1 | tee build.log
# sudo docker buildx build -f ./Dockerfile-git --build-arg ORG_GRADLE_PROJECT_isProduction=yes --build-context project=https://borisgra:gihub_token@github.com/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
#docker image tag d583c3ac45fd borisgra/query-gra:tagname