forked from eth-educators/eth-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.binary
46 lines (36 loc) · 1.3 KB
/
Dockerfile.binary
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
ARG DOCKER_TAG
FROM nethermind/nethermind:${DOCKER_TAG}
# Unused, this is here to avoid build time complaints
ARG BUILD_TARGET
ARG USER=nethermind
ARG UID=10001
# GID 10002 is deliberate so it can exchange secret with CL
ARG GID=10002
RUN addgroup \
--gid "${GID}" \
"${USER}"
# See https://stackoverflow.com/a/55757473/12429735RUN
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
--ingroup "${USER}" \
"${USER}"
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y ca-certificates gosu tzdata wget; \
rm -rf /var/lib/apt/lists/*; \
# verify that the binary works
gosu nobody true
# This only goes so far. keystore, logs and nethermind_db are volumes and need to be chown'd in the entrypoint
RUN chown -R ${USER}:${USER} /nethermind
RUN mkdir -p /var/lib/nethermind/ee-secret && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 777 /var/lib/nethermind/ee-secret
# Cannot assume buildkit, hence no chmod
COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/
# Belt and suspenders
RUN chmod -R 755 /usr/local/bin/*
USER ${USER}
ENTRYPOINT ["dotnet","/nethermind/Nethermind.Runner.dll"]