Skip to content

Commit

Permalink
Define UID and GID for erigon user as well as STOPSIGNAL. (#12959)
Browse files Browse the repository at this point in the history
  • Loading branch information
lystopad authored Dec 3, 2024
1 parent 172fba9 commit e4165ba
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG RELEASE_DOCKER_BASE_IMAGE="alpine:3.20.1" \
CI_CD_MAIN_BUILDER_IMAGE="golang:1.22-bookworm" \
CI_CD_MAIN_TARGET_BASE_IMAGE="alpine:3.20.1" \
UID_ERIGON=1000 \
GID_ERIGON=1000 \
EXPOSED_PORTS="8545 \
8551 \
8546 \
Expand Down Expand Up @@ -30,21 +32,25 @@ FROM ${RELEASE_DOCKER_BASE_IMAGE} AS release

ARG USER=erigon \
GROUP=erigon \
UID_ERIGON \
GID_ERIGON \
APPLICATION \
EXPOSED_PORTS

STOPSIGNAL 2

RUN --mount=type=bind,from=temporary,source=/tmp/${APPLICATION},target=/tmp/${APPLICATION} \
apk add --no-cache ca-certificates tzdata && \
addgroup ${GROUP} && \
adduser -D -h /home/${USER} -G ${GROUP} ${USER} && \
addgroup -g ${GID_ERIGON} ${GROUP} && \
adduser -D -u ${UID_ERIGON} -h /home/${USER} -G ${GROUP} ${USER} && \
install -d -o ${USER} -g ${GROUP} /home/${USER}/.local /home/${USER}/.local/share /home/${USER}/.local/share/erigon && \
install -o ${USER} -g ${GROUP} /tmp/${APPLICATION}/erigon /usr/local/bin/ && \
install -o ${USER} -g ${GROUP} /tmp/${APPLICATION}/integration /usr/local/bin/ && \
install -o ${USER} -g ${GROUP} /tmp/${APPLICATION}/diag /usr/local/bin/ && \
install -o ${USER} -g ${GROUP} /tmp/${APPLICATION}/sentry /usr/local/bin/ && \
install -o ${USER} -g ${GROUP} /tmp/${APPLICATION}/txpool /usr/local/bin/ && \
install -o ${USER} -g ${GROUP} /tmp/${APPLICATION}/downloader /usr/local/bin/ && \
install -o ${USER} -g ${GROUP} /tmp/${APPLICATION}/rpcdaemon /usr/local/bin/
install -o root -g root /tmp/${APPLICATION}/erigon /usr/local/bin/ && \
install -o root -g root /tmp/${APPLICATION}/integration /usr/local/bin/ && \
install -o root -g root /tmp/${APPLICATION}/diag /usr/local/bin/ && \
install -o root -g root /tmp/${APPLICATION}/sentry /usr/local/bin/ && \
install -o root -g root /tmp/${APPLICATION}/txpool /usr/local/bin/ && \
install -o root -g root /tmp/${APPLICATION}/downloader /usr/local/bin/ && \
install -o root -g root /tmp/${APPLICATION}/rpcdaemon /usr/local/bin/

VOLUME [ "/home/${USER}" ]
WORKDIR /home/${USER}
Expand Down Expand Up @@ -90,4 +96,4 @@ EXPOSE ${EXPOSED_PORTS}

ENTRYPOINT [ "/usr/local/bin/erigon" ]

### End of CI-CD : main branch docker image publishing for each new commit id
### End of CI-CD : main branch docker image publishing for each new commit id

0 comments on commit e4165ba

Please sign in to comment.