-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (42 loc) · 1.2 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM ubuntu:20.04 as builder
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
curl \
openjdk-11-jdk-headless \
; \
rm -rf /var/lib/apt/lists/*
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
git \
; \
rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 -s /bin/bash teku
USER teku
ARG VERSION
RUN if test ${#VERSION} -ge 40 ; \
then \
echo Checking out commit $VERSION && \
git clone https://github.com/ConsenSys/teku.git /home/teku/teku && \
cd /home/teku/teku && git reset --hard $VERSION ; \
else \
echo Checking out branch $VERSION && \
git clone --depth 1 -b ${VERSION} https://github.com/ConsenSys/teku.git /home/teku/teku ; \
fi
RUN set -ex; \
cd /home/teku/teku; \
./gradlew distTar installDist
FROM ubuntu:20.04
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
openjdk-11-jre-headless \
; \
rm -rf /var/lib/apt/lists/*
# After a successful build, distribution packages are available in build/distributions.
COPY --from=builder /home/teku/teku/build/install/teku /opt/
RUN useradd -m -u 1000 -s /bin/bash teku
USER teku
WORKDIR /opt
ENTRYPOINT [ "./bin/teku" ]