diff --git a/Dockerfile.release b/Dockerfile.release index f23352ec274..cac5c3b0e78 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -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 \ @@ -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} @@ -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 \ No newline at end of file +### End of CI-CD : main branch docker image publishing for each new commit id