-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (24 loc) · 822 Bytes
/
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
ARG ENERGI_VERSION
FROM energicryptocurrency/energi:${ENERGI_VERSION}
ARG ENERGI_BIN
ARG ENERGI_CORE_DIR
ARG USER_AND_GROUP_ID=1000
ARG USERNAME=nrgstaker
ARG STAKER_HOME
ENV ENERGI_BIN="${ENERGI_BIN:?}"
ENV ENERGI_CORE_DIR="${ENERGI_CORE_DIR:?}"
ENV STAKER_HOME="${STAKER_HOME:?}"
WORKDIR "${STAKER_HOME}/energi"
RUN addgroup --gid ${USER_AND_GROUP_ID} ${USERNAME} && \
adduser \
--uid ${USER_AND_GROUP_ID} ${USERNAME} \
--ingroup ${USERNAME} \
--disabled-password && \
apk --no-cache add curl procps && \
cd "$(dirname "${ENERGI_BIN}")" && \
ln -s energi3 "$(basename "${ENERGI_BIN}")" && \
mkdir ${ENERGI_CORE_DIR} && \
chown -R ${USERNAME}:${USERNAME} ${STAKER_HOME}
COPY --chown=${USERNAME}:${USERNAME} [ "scripts", "./" ]
USER ${USERNAME}
ENTRYPOINT ["/bin/sh", "energi-core-run.sh"]