From ceaa4b72725b2c82303fa5606803322cb0d67ec8 Mon Sep 17 00:00:00 2001 From: Chibuike Emmanuel Date: Sun, 24 Oct 2021 21:26:47 +0100 Subject: [PATCH 01/10] Using the ELECTRUM_NETWORK call instead. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 754b874..9ad4746 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,4 @@ services: environment: ELECTRUM_USER: electrum ELECTRUM_PASSWORD: changeme - TESTNET: False + ELECTRUM_NETWORK: testnet From f517e59ee2faf1245ec935586c346d05fa4efc2c Mon Sep 17 00:00:00 2001 From: Chibuike Emmanuel Osita Date: Mon, 25 Oct 2021 01:24:24 +0100 Subject: [PATCH 02/10] updates on the docker related files --- Dockerfile | 45 +++++++++++++++++++++++++++----------------- docker-compose.yml | 23 ++++++++++++++++------ docker-entrypoint.sh | 5 +++-- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index f281cad..a83926b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ARG BUILD_DATE ARG VCS_REF ARG VERSION ARG CHECKSUM_SHA512 +ARG ELECTRUM_NETWORK LABEL maintainer="osintsev@gmail.com" \ org.label-schema.vendor="Distirbuted Solutions, Inc." \ org.label-schema.build-date=$BUILD_DATE \ @@ -18,29 +19,39 @@ LABEL maintainer="osintsev@gmail.com" \ 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 + +ARG ELECTRUM_VERSION $VERSION +ARG ELECTRUM_USER electrum +ARG ELECTRUM_PASSWORD electrumz # XXX: CHANGE REQUIRED! +ARG ELECTRUM_HOME /home/$ELECTRUM_USER +ARG ELECTRUM_NETWORK $ELECTRUM_NETWORK # IMPORTANT: always verify gpg signature before changing a hash here! -ENV ELECTRUM_CHECKSUM_SHA512 $CHECKSUM_SHA512 +# ENV ELECTRUM_CHECKSUM_SHA512 + +RUN apk add openssl-dev libffi-dev python3-dev +RUN echo "${ELECTRUM_VERSION} ${ELECTRUM_HOME}" RUN adduser -D $ELECTRUM_USER && \ - apk --no-cache add --virtual build-dependencies gcc musl-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 Electrum-${ELECTRUM_VERSION}.tar.gz && \ - rm -f Electrum-${ELECTRUM_VERSION}.tar.gz && \ - apk del build-dependencies + apk add --no-cache \ + libressl-dev \ + musl-dev \ + libsecp256k1-dev \ + libffi-dev && \ + apk --no-cache add --virtual build-dependencies gcc musl-dev && \ + wget https://download.electrum.org/${ELECTRUM_VERSION}/Electrum-${ELECTRUM_VERSION}.tar.gz && \ + pip install --no-cache-dir cryptography==2.1.4 && \ + # pip3 install cryptography \ + # pip3 install pycryptodomex \ + pip3 install 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/ && \ + ${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 diff --git a/docker-compose.yml b/docker-compose.yml index 9ad4746..f54f770 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,22 @@ -version: '3' +version: "3" services: electrum: - build: . + build: + context: . + args: + - ELECTRUM_USER=electrum + - ELECTRUM_PASSWORD=changeme + - ELECTRUM_NETWORK=testnet + - ELECTRUM_VERSION=4.1.5 + - ELECTRUM_CHECKSUM_SHA512=12 + - ELECTRUM_HOME=/home/electrum + environment: + - ELECTRUM_USER=electrum + - ELECTRUM_PASSWORD=changeme + - ELECTRUM_NETWORK=testnet + - ELECTRUM_VERSION=4.1.5 + - ELECTRUM_CHECKSUM_SHA512=12 + - ELECTRUM_HOME=/home/electrum ports: - 127.0.0.1:7000:7000 - environment: - ELECTRUM_USER: electrum - ELECTRUM_PASSWORD: changeme - ELECTRUM_NETWORK: testnet diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 284636e..e2405cb 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -15,6 +15,7 @@ fi trap 'pkill -TERM -P1; electrum daemon stop; exit 0' SIGTERM # Set config +electrum $FLAGS daemon -d electrum $FLAGS setconfig rpcuser ${ELECTRUM_USER} electrum $FLAGS setconfig rpcpassword ${ELECTRUM_PASSWORD} electrum $FLAGS setconfig rpchost 0.0.0.0 @@ -23,8 +24,8 @@ electrum $FLAGS setconfig rpcport 7000 # XXX: Check load wallet or create # Run application -electrum $FLAGS daemon start - +# electrum $FLAGS daemon start +electrum $FLAGS daemon -d # Wait forever while true; do tail -f /dev/null & wait ${!} From 50eafef9aa3773a2ea02e40ed527b92f239a3587 Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Fri, 1 Apr 2022 10:45:06 +0300 Subject: [PATCH 03/10] Update docker-entrypoint.sh Updates --- docker-entrypoint.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index e2405cb..0ea2ef4 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -15,7 +15,6 @@ fi trap 'pkill -TERM -P1; electrum daemon stop; exit 0' SIGTERM # Set config -electrum $FLAGS daemon -d electrum $FLAGS setconfig rpcuser ${ELECTRUM_USER} electrum $FLAGS setconfig rpcpassword ${ELECTRUM_PASSWORD} electrum $FLAGS setconfig rpchost 0.0.0.0 @@ -24,8 +23,8 @@ electrum $FLAGS setconfig rpcport 7000 # XXX: Check load wallet or create # Run application -# electrum $FLAGS daemon start electrum $FLAGS daemon -d + # Wait forever while true; do tail -f /dev/null & wait ${!} From 96b32bd548a6f231226cd2d0eceafd5b18606b8d Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Fri, 1 Apr 2022 10:49:39 +0300 Subject: [PATCH 04/10] Update docker-compose.yml --- docker-compose.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f54f770..5d445f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,15 +2,7 @@ version: "3" services: electrum: - build: - context: . - args: - - ELECTRUM_USER=electrum - - ELECTRUM_PASSWORD=changeme - - ELECTRUM_NETWORK=testnet - - ELECTRUM_VERSION=4.1.5 - - ELECTRUM_CHECKSUM_SHA512=12 - - ELECTRUM_HOME=/home/electrum + build: . environment: - ELECTRUM_USER=electrum - ELECTRUM_PASSWORD=changeme From d98ca618fea9e4862d11d74859e5da3164fafb90 Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Fri, 1 Apr 2022 12:25:35 +0300 Subject: [PATCH 05/10] Update Dockerfile --- Dockerfile | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7811c1b..a044672 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ ARG BUILD_DATE ARG VCS_REF ARG VERSION ARG CHECKSUM_SHA512 -ARG ELECTRUM_NETWORK LABEL maintainer="osintsev@gmail.com" \ org.label-schema.vendor="Boroda Group" \ org.label-schema.build-date=$BUILD_DATE \ @@ -20,38 +19,38 @@ LABEL maintainer="osintsev@gmail.com" \ org.label-schema.schema-version="1.0" -ARG ELECTRUM_VERSION $VERSION -ARG ELECTRUM_USER electrum -ARG ELECTRUM_PASSWORD electrumz # XXX: CHANGE REQUIRED! -ARG ELECTRUM_HOME /home/$ELECTRUM_USER -ARG ELECTRUM_NETWORK $ELECTRUM_NETWORK +ENV ELECTRUM_VERSION $VERSION +ENV ELECTRUM_USER electrum +ENV ELECTRUM_PASSWORD electrumz # XXX: CHANGE REQUIRED! +ENV ELECTRUM_HOME /home/$ELECTRUM_USER +ENV ELECTRUM_NETWORK testnet -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 -RUN apk add openssl-dev libffi-dev python3-dev - RUN echo "${ELECTRUM_VERSION} ${ELECTRUM_HOME}" 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 + apk add --no-cache \ + libressl-dev \ + musl-dev \ + libsecp256k1-dev \ + libffi-dev && \ + apk --no-cache add --virtual build-dependencies gcc musl-dev libsecp256k1-dev libressl-dev && \ + wget https://download.electrum.org/${ELECTRUM_VERSION}/Electrum-${ELECTRUM_VERSION}.tar.gz && \ + pip install --no-cache-dir cryptography==2.1.4 && \ + # pip3 install cryptography \ + # pip3 install pycryptodomex \ + pip3 install 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 + ${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 @@ -60,4 +59,4 @@ EXPOSE 7000 COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["electrum"] \ No newline at end of file +CMD ["electrum"] From 4cb8dd6c6059fed81fb2b670c3f4a13ee5fd4d34 Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Fri, 1 Apr 2022 12:49:36 +0300 Subject: [PATCH 06/10] Updatres --- docker-compose.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0278ff6..0dd0c73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,15 +7,9 @@ services: - ELECTRUM_USER=electrum - ELECTRUM_PASSWORD=changeme - ELECTRUM_NETWORK=testnet - - ELECTRUM_VERSION=4.1.5 - - ELECTRUM_CHECKSUM_SHA512=12 - - ELECTRUM_HOME=/home/electrum + - ELECTRUM_VERSION=4.2.1 ports: - 127.0.0.1:7000:7000 - environment: - ELECTRUM_USER: electrum - ELECTRUM_PASSWORD: changeme - ELECTRUM_NETWORK: testnet container_name: electrum image: osminogin/docker-electrum-daemon volumes: From 6af93f834206ad1d76a82c6f2e1d95b54c40788f Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Fri, 1 Apr 2022 13:03:46 +0300 Subject: [PATCH 07/10] Update --- Dockerfile | 19 ++----------------- docker-compose.yml | 7 +------ 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4bdb040..0f517f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,20 +18,16 @@ LABEL maintainer="osintsev@gmail.com" \ 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 testnet -<<<<<<< HEAD -======= RUN mkdir -p /data ${ELECTRUM_HOME} && \ ln -sf /data ${ELECTRUM_HOME}/.electrum && \ chown ${ELECTRUM_USER} ${ELECTRUM_HOME}/.electrum /data ->>>>>>> a848140da0152b2e635a16d3676885379742fa49 # IMPORTANT: always verify gpg signature before changing a hash here! # ENV ELECTRUM_CHECKSUM_SHA512 @@ -42,29 +38,18 @@ RUN adduser -D $ELECTRUM_USER && \ musl-dev \ libsecp256k1-dev \ libffi-dev && \ - apk --no-cache add --virtual build-dependencies gcc musl-dev libsecp256k1-dev libressl-dev && \ + apk --no-cache add --virtual build-dependencies gcc musl-dev libsecp256k1-dev libressl-dev libffi-dev && \ wget https://download.electrum.org/${ELECTRUM_VERSION}/Electrum-${ELECTRUM_VERSION}.tar.gz && \ - pip install --no-cache-dir cryptography==2.1.4 && \ - # pip3 install cryptography \ - # pip3 install pycryptodomex \ - pip3 install Electrum-${ELECTRUM_VERSION}.tar.gz && \ + pip3 install --no-cache-dir cryptography==2.1.4 && Electrum-${ELECTRUM_VERSION}.tar.gz && \ rm -f Electrum-${ELECTRUM_VERSION}.tar.gz && \ apk del build-dependencies RUN mkdir -p /data \ -<<<<<<< HEAD - ${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 && \ -======= ${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 && \ ->>>>>>> a848140da0152b2e635a16d3676885379742fa49 chown -R ${ELECTRUM_USER} ${ELECTRUM_HOME}/.electrum /data USER $ELECTRUM_USER diff --git a/docker-compose.yml b/docker-compose.yml index bceb106..1ff52f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,12 +10,7 @@ services: - 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 \ No newline at end of file + - ../electrum:/data From c54a7b39ba6823de5aa0c6a0f539172efa674da4 Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Fri, 1 Apr 2022 13:03:46 +0300 Subject: [PATCH 08/10] Updates --- .github/workflows/rebase.yaml | 2 +- Dockerfile | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rebase.yaml b/.github/workflows/rebase.yaml index c2b9aca..a96ab8d 100644 --- a/.github/workflows/rebase.yaml +++ b/.github/workflows/rebase.yaml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 0f517f7..c614603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,13 +21,10 @@ LABEL maintainer="osintsev@gmail.com" \ ENV ELECTRUM_VERSION $VERSION ENV ELECTRUM_USER electrum ENV ELECTRUM_PASSWORD electrumz # XXX: CHANGE REQUIRED! +ENV ELECTRUM_VERSION 4.2.0 ENV ELECTRUM_HOME /home/$ELECTRUM_USER ENV ELECTRUM_NETWORK testnet -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 From 3abbe30c01bb396b3c4ee3ce567bcb4427b2d6b0 Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Fri, 1 Apr 2022 13:43:27 +0300 Subject: [PATCH 09/10] Update Dockerfile --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c614603..f010574 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.9.12-alpine ARG BUILD_DATE ARG VCS_REF -ARG VERSION +# ARG VERSION ARG CHECKSUM_SHA512 LABEL maintainer="osintsev@gmail.com" \ org.label-schema.vendor="Boroda Group" \ @@ -18,10 +18,9 @@ LABEL maintainer="osintsev@gmail.com" \ 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_VERSION 4.2.0 ENV ELECTRUM_HOME /home/$ELECTRUM_USER ENV ELECTRUM_NETWORK testnet @@ -35,9 +34,10 @@ RUN adduser -D $ELECTRUM_USER && \ musl-dev \ libsecp256k1-dev \ libffi-dev && \ - apk --no-cache add --virtual build-dependencies gcc musl-dev libsecp256k1-dev libressl-dev libffi-dev && \ + apk --no-cache 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 && \ - pip3 install --no-cache-dir cryptography==2.1.4 && Electrum-${ELECTRUM_VERSION}.tar.gz && \ + tar xvzf Electrum-${ELECTRUM_VERSION}.tar.gz && \ + pip3 install --user .[gui,crypto] && \ rm -f Electrum-${ELECTRUM_VERSION}.tar.gz && \ apk del build-dependencies From 5005295fbcc473578dd0c3e178fed17506ce8306 Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Thu, 5 May 2022 12:53:45 +0300 Subject: [PATCH 10/10] Fixes --- Dockerfile | 28 ++++++++++++++++++---------- Makefile | 2 +- docker-compose.yml | 11 +++++------ docker-entrypoint.sh | 2 +- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index f010574..9de7f32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9.12-alpine +FROM python:3.10-alpine ARG BUILD_DATE ARG VCS_REF @@ -20,7 +20,7 @@ LABEL maintainer="osintsev@gmail.com" \ 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 testnet @@ -28,16 +28,25 @@ ENV ELECTRUM_NETWORK testnet # ENV ELECTRUM_CHECKSUM_SHA512 RUN echo "${ELECTRUM_VERSION} ${ELECTRUM_HOME}" -RUN adduser -D $ELECTRUM_USER && \ - apk add --no-cache \ +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 && \ - apk --no-cache 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 && \ - pip3 install --user .[gui,crypto] && \ + tar xvzf Electrum-${ELECTRUM_VERSION}.tar.gz + +RUN pip3 install cryptography Electrum-${ELECTRUM_VERSION}.tar.gz && \ rm -f Electrum-${ELECTRUM_VERSION}.tar.gz && \ apk del build-dependencies @@ -54,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"] diff --git a/Makefile b/Makefile index d500e30..391985d 100644 --- a/Makefile +++ b/Makefile @@ -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) \ diff --git a/docker-compose.yml b/docker-compose.yml index 1ff52f1..65da66f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 + ELECTRUM_USER: electrum + ELECTRUM_PASSWORD: changeme + ELECTRUM_NETWORK: testnet + ELECTRUM_VERSION: 4.2.1 ports: - 127.0.0.1:7000:7000 - container_name: electrum - image: osminogin/docker-electrum-daemon volumes: - ../electrum:/data diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index c7f7c22..ff5d865 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -ex # Network switch