From a29ea19a16631cf0b98f3135a80ea2936f89f1b4 Mon Sep 17 00:00:00 2001 From: dapplion Date: Wed, 23 Sep 2020 17:29:52 +0300 Subject: [PATCH 1/2] Support multi-arch --- build/Dockerfile | 17 ++++++++++------- dappnode_package.json | 1 + docker-compose.yml | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 6fe02e4..e96bc3d 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,16 +1,19 @@ +# Build Geth in a stock Go builder container +FROM golang:1.14-alpine as builder + ARG UPSTREAM_VERSION -FROM ethereum/client-go:${UPSTREAM_VERSION} as geth -# Pull Parity into a second stage deploy alpine container +RUN apk add --no-cache make gcc musl-dev linux-headers git && \ + git clone -b ${UPSTREAM_VERSION} https://github.com/ethereum/go-ethereum.git && \ + cd go-ethereum && make geth + + FROM alpine:edge RUN apk --no-cache add \ - libstdc++ \ - eudev-libs \ - libgcc \ - bash + libstdc++ eudev-libs libgcc bash -COPY --from=geth /usr/local/bin/geth /usr/local/bin/geth +COPY --from=builder /go/go-ethereum/build/bin/geth /usr/local/bin ENV SYNCMODE fast ENTRYPOINT geth --rpc --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcvhosts "*" --ws --wsorigins "*" --wsaddr 0.0.0.0 --syncmode ${SYNCMODE:-fast} --nousb $EXTRA_OPTS diff --git a/dappnode_package.json b/dappnode_package.json index a80e22f..414803e 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -5,6 +5,7 @@ "shortDescription": "Geth is the official Go implementation of the Ethereum protocol.", "description": "Ethereum is a global, open-source platform for decentralized applications where you can write code that controls digital value, runs exactly as programmed, and is accessible anywhere in the world.", "type": "library", + "architectures": ["linux/amd64", "linux/arm64"], "chain": "ethereum", "author": "DAppNode Association (https://github.com/dappnode)", "contributors": [ diff --git a/docker-compose.yml b/docker-compose.yml index 8b8af4c..2b049c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: ./build args: - - UPSTREAM_VERSION + - UPSTREAM_VERSION=v1.9.21 volumes: - 'geth:/root/.ethereum' environment: From 6c0ea5af8c79d72aadfe832f8f91b1449308a2d3 Mon Sep 17 00:00:00 2001 From: Lion - dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed, 23 Sep 2020 17:36:14 +0300 Subject: [PATCH 2/2] Docker-compose build args as object format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Eduardo Antuña Díez <20141918+eduadiez@users.noreply.github.com> --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2b049c4..5bc55a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: ./build args: - - UPSTREAM_VERSION=v1.9.21 + UPSTREAM_VERSION: v1.9.21 volumes: - 'geth:/root/.ethereum' environment: