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 684aa8e..9de7f32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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="osintsev@gmail.com" \ org.label-schema.vendor="Boroda Group" \ @@ -18,27 +18,37 @@ 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_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/ \ @@ -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"] 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 ae33a70..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 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 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