forked from NemProject/nem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (31 loc) · 1.05 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (31 loc) · 1.05 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
FROM ubuntu:22.04 AS builder
# install dependencies (install tzdata first to prevent 'geographic area' prompt)
RUN apt-get update \
&& apt-get install -y tzdata \
&& apt-get install -y openjdk-11-jdk-headless git libssl-dev maven ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /build/nem
# copy local code into /build/nem
COPY . /build/nem
WORKDIR /build/nem
# actually build (using java 11)
RUN mvn clean package -DskipTests=true \
&& cd infra \
&& bash ./package.prepare.sh package
# second stage of multistage build
FROM ubuntu:22.04 AS runner
ENV MEMORY_MS=6G
ENV MEMORY_MX=6G
ARG UID=11001
ARG UNAME=nem
RUN useradd --uid $UID -ms /bin/bash $UNAME
#install jre 11 for runtime
RUN apt-get update \
&& apt-get install -y openjdk-11-jre-headless
VOLUME ["/usersettings"]
WORKDIR /app
COPY --from=builder /build/nem/infra/package /app
RUN chown -R ${UNAME} /app
USER $UNAME
CMD ["bash", "-c", "java -Xms${MEMORY_MS} -Xmx${MEMORY_MX} -cp /usersettings:./nis/*:./libs/* org.nem.deploy.CommonStarter"]