-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathDockerfile
58 lines (50 loc) · 2.42 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM python:3.9.12-alpine
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ARG CHECKSUM_SHA512
LABEL maintainer="[email protected]" \
org.label-schema.vendor="Boroda Group" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Electrum wallet (RPC enabled)" \
org.label-schema.description="Electrum wallet with JSON-RPC enabled (daemon mode)" \
org.label-schema.version=$VERSION \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/osminogin/docker-electrum-daemon" \
org.label-schema.usage="https://github.com/osminogin/docker-electrum-daemon#getting-started" \
org.label-schema.license="MIT" \
org.label-schema.url="https://electrum.org" \
org.label-schema.docker.cmd='docker run -d --name electrum-daemon --publish 127.0.0.1:7000:7000 --volume /srv/electrum:/data osminogin/electrum-daemon' \
org.label-schema.schema-version="1.0"
ENV ELECTRUM_VERSION $VERSION
ENV ELECTRUM_USER electrum
ENV ELECTRUM_PASSWORD electrumz # XXX: CHANGE REQUIRED!
ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_NETWORK mainnet
RUN mkdir -p /data ${ELECTRUM_HOME} && \
ln -sf /data ${ELECTRUM_HOME}/.electrum && \
chown ${ELECTRUM_USER} ${ELECTRUM_HOME}/.electrum /data
# IMPORTANT: always verify gpg signature before changing a hash here!
ENV ELECTRUM_CHECKSUM_SHA512 $CHECKSUM_SHA512
RUN adduser -D $ELECTRUM_USER && \
apk --no-cache add --virtual build-dependencies gcc musl-dev libsecp256k1 libsecp256k1-dev libressl-dev && \
wget https://download.electrum.org/${ELECTRUM_VERSION}/Electrum-${ELECTRUM_VERSION}.tar.gz && \
[ "${ELECTRUM_CHECKSUM_SHA512} Electrum-${ELECTRUM_VERSION}.tar.gz" = "$(sha512sum Electrum-${ELECTRUM_VERSION}.tar.gz)" ] && \
echo -e "**************************\n SHA 512 Checksum OK\n**************************" && \
pip3 install cryptography==2.1.4 pycryptodomex Electrum-${ELECTRUM_VERSION}.tar.gz && \
rm -f Electrum-${ELECTRUM_VERSION}.tar.gz && \
apk del build-dependencies
RUN mkdir -p /data \
${ELECTRUM_HOME}/.electrum/wallets/ \
${ELECTRUM_HOME}/.electrum/testnet/wallets/ \
${ELECTRUM_HOME}/.electrum/regtest/wallets/ \
${ELECTRUM_HOME}/.electrum/simnet/wallets/ && \
ln -sf ${ELECTRUM_HOME}/.electrum/ /data && \
chown -R ${ELECTRUM_USER} ${ELECTRUM_HOME}/.electrum /data
USER $ELECTRUM_USER
WORKDIR $ELECTRUM_HOME
VOLUME /data
EXPOSE 7000
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["electrum"]