Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the ELECTRUM_NETWORK call instead. #17

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion .github/workflows/rebase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1
uses: cirrus-actions/rebase@1.5
if: steps.check.outputs.triggered == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 30 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.9.12-alpine
FROM python:3.10-alpine

ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
# ARG VERSION
ARG CHECKSUM_SHA512
LABEL maintainer="[email protected]" \
org.label-schema.vendor="Boroda Group" \
Expand All @@ -18,27 +18,37 @@ LABEL maintainer="[email protected]" \
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_VERSION 4.2.1
ENV ELECTRUM_USER electrum
ENV ELECTRUM_PASSWORD electrumz # XXX: CHANGE REQUIRED!
ENV ELECTRUM_PASSWORD electrumz
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
ENV ELECTRUM_NETWORK testnet

# IMPORTANT: always verify gpg signature before changing a hash here!
ENV ELECTRUM_CHECKSUM_SHA512 $CHECKSUM_SHA512
# ENV ELECTRUM_CHECKSUM_SHA512

RUN echo "${ELECTRUM_VERSION} ${ELECTRUM_HOME}"
RUN adduser -D $ELECTRUM_USER
RUN apk update && \
apk add bash \
libressl-dev \
musl-dev \
libsecp256k1-dev \
libffi-dev
RUN apk add --virtual \
build-dependencies \
gcc \
musl-dev \
libsecp256k1 \
libsecp256k1-dev \
libressl-dev \
libffi-dev && \
wget https://download.electrum.org/${ELECTRUM_VERSION}/Electrum-${ELECTRUM_VERSION}.tar.gz && \
tar xvzf Electrum-${ELECTRUM_VERSION}.tar.gz

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 pip3 install cryptography Electrum-${ELECTRUM_VERSION}.tar.gz && \
rm -f Electrum-${ELECTRUM_VERSION}.tar.gz && \
apk del build-dependencies

RUN mkdir -p /data \
${ELECTRUM_HOME}/.electrum/wallets/ \
Expand All @@ -53,6 +63,5 @@ WORKDIR $ELECTRUM_HOME
VOLUME /data
EXPOSE 7000

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["electrum"]
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ download:
@

docker_build:
@docker build \
@docker build --network host \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VERSION=$(ELECTRUM_VERSION) \
--build-arg CHECKSUM_SHA512=$(ELECTRUM_CHECKSUM_SHA512) \
Expand Down
13 changes: 6 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ version: '3.7'
services:
electrum:
build: .
container_name: electrum
environment:
ELECTRUM_USER: electrum
ELECTRUM_PASSWORD: changeme
ELECTRUM_NETWORK: testnet
ELECTRUM_VERSION: 4.2.1
ports:
- 127.0.0.1:7000:7000
environment:
- ELECTRUM_USER=electrum
- ELECTRUM_PASSWORD=changeme
- ELECTRUM_NETWORK=testnet
- ELECTRUM_VERSION=4.2.1
container_name: electrum
image: osminogin/docker-electrum-daemon
volumes:
- ../electrum:/data
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
set -ex

# Network switch
Expand Down