-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-git-run
More file actions
71 lines (57 loc) · 2.44 KB
/
Dockerfile-git-run
File metadata and controls
71 lines (57 loc) · 2.44 KB
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
63
64
65
66
67
68
69
70
71
#Create image from source use RUN git
#https://codereinvented.net/blog/
# 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
ARG GIT="https://github.com/borisgra/fullWeb.git"
ENV GIT=$GIT
RUN git clone $GIT .
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"]
# GCP: e2-micro , g1-small
# wget -qO- https://raw.githubusercontent.com/borisgra/fullWeb/main/Dockerfile-git-run | docker buildx build -f - -t borisgra/query-gra:src .
# wget -qO- https://raw.githubusercontent.com/borisgra/fullWeb/main/Dockerfile-git-run | docker buildx build -f - --build-arg GIT=https://borisgra:<git-token>@github.com/borisgra/jvm-js-fullstack.git -t borisgra/query-gra:src .
# sudo docker image build -t borisgra/query-gra:src .
# sudo docker image build --build-arg GIT=https://borisgra:<git-token>@github.com/borisgra/jvm-js-fullstack.git -t borisgra/query-gra:src .
# sudo docker image build --progress=plain -t borisgra/query-gra:src . 2>&1 | tee build.log
# sudo docker image build --no-cache -t borisgra/query-gra:latest .
# 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
# df -h --total
# du -sh query-gra
#docker image tag d583c3ac45fd borisgra/query-gra:tagname