forked from eth-educators/eth-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.binary
35 lines (25 loc) · 966 Bytes
/
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
ARG DOCKER_TAG
ARG DOCKER_REPO
FROM ${DOCKER_REPO}:${DOCKER_TAG}
# Unused but included to avoid warnings
ARG BUILD_TARGET
ARG SRC_REPO
ARG USER=besu
ARG UID=10001
# GID 10002 is deliberate so it can exchange secret with CL
ARG GID=10002
USER root
RUN groupmod -g "${GID}" besu && usermod -u "${UID}" -g "${GID}" besu
RUN set -eux; \
apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y gosu ca-certificates tzdata git wget; \
rm -rf /var/lib/apt/lists/*; \
# verify that the binary works
gosu nobody true
# Create data mount point with permissions
RUN mkdir -p /var/lib/besu/ee-secret && chown -R ${USER}:${USER} /var/lib/besu && chmod -R 700 /var/lib/besu && chmod 777 /var/lib/besu/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 ["/opt/besu/bin/besu"]