forked from rsksmart/rskj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (28 loc) · 1.41 KB
/
Dockerfile
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
FROM eclipse-temurin:17-jdk AS build
RUN apt-get update -y && \
apt-get install -y git curl gnupg
RUN useradd -ms /bin/bash rsk
USER rsk
WORKDIR /home/rsk
COPY --chown=rsk:rsk . ./
RUN gpg --keyserver https://secchannel.rsk.co/SUPPORT.asc --recv-keys 1DC9157991323D23FD37BAA7A6DBEAC640C5A14B && \
gpg --verify --output SHA256SUMS SHA256SUMS.asc && \
sha256sum --check SHA256SUMS && \
./configure.sh && \
./gradlew --no-daemon clean build -x test && \
file=rskj-core/src/main/resources/version.properties && \
version_number=$(sed -n 's/^versionNumber=//p' "$file" | tr -d "\"'") && \
modifier=$(sed -n 's/^modifier=//p' "$file" | tr -d "\"'") && \
cp "rskj-core/build/libs/rskj-core-$version_number-$modifier-all.jar" rsk.jar
FROM eclipse-temurin:17-jre
LABEL org.opencontainers.image.authors="[email protected]"
RUN useradd -ms /sbin/nologin -d /var/lib/rsk rsk
USER rsk
WORKDIR /var/lib/rsk
COPY --from=build --chown=rsk:rsk /home/rsk/rsk.jar ./
ENV DEFAULT_JVM_OPTS="-Xms4G"
ENV RSKJ_SYS_PROPS="-Drpc.providers.web.http.bind_address=0.0.0.0 -Drpc.providers.web.http.hosts.0=localhost -Drpc.providers.web.http.hosts.1=127.0.0.1 -Drpc.providers.web.http.hosts.2=::1"
ENV RSKJ_LOG_PROPS="-Dlogging.stdout=INFO"
ENV RSKJ_CLASS=co.rsk.Start
ENV RSKJ_OPTS=""
ENTRYPOINT ["/bin/sh", "-c", "exec java $DEFAULT_JVM_OPTS $RSKJ_SYS_PROPS $RSKJ_LOG_PROPS -cp rsk.jar $RSKJ_CLASS $RSKJ_OPTS \"${@}\"", "--"]