diff --git a/Dockerfile b/Dockerfile index 29cdc80f96..2e1601dec2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,19 @@ -# Build Geth in a stock Go builder container FROM golang:1.10-alpine as builder RUN apk add --no-cache make gcc musl-dev linux-headers -ADD . /go-ethereum -RUN cd /go-ethereum && make geth +ADD . /tomochain +RUN cd /tomochain && make tomo -# Pull Geth into a second stage deploy alpine container FROM alpine:latest -RUN apk add --no-cache ca-certificates -COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ +LABEL maintainer="etienne@tomochain.com" -EXPOSE 8545 8546 30303 30303/udp 30304/udp -ENTRYPOINT ["geth"] +COPY --from=builder /tomochain/build/bin/tomo /usr/local/bin/tomo + +RUN chmod +x /usr/local/bin/tomo + +EXPOSE 8545 +EXPOSE 30303 + +ENTRYPOINT ["/usr/local/bin/tomo", "--help"] diff --git a/Dockerfile.alltools b/Dockerfile.alltools deleted file mode 100644 index 1047738d25..0000000000 --- a/Dockerfile.alltools +++ /dev/null @@ -1,15 +0,0 @@ -# Build Geth in a stock Go builder container -FROM golang:1.10-alpine as builder - -RUN apk add --no-cache make gcc musl-dev linux-headers - -ADD . /go-ethereum -RUN cd /go-ethereum && make all - -# Pull all binaries into a second stage deploy alpine container -FROM alpine:latest - -RUN apk add --no-cache ca-certificates -COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/ - -EXPOSE 8545 8546 30303 30303/udp 30304/udp diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000000..987c266fd0 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,11 @@ +version: "3.4" + +services: + + sut: + build: . + volumes: + - "./docker/docker_tests.sh:/test/docker_tests.sh" + entrypoint: + - /bin/sh + - /test/docker_tests.sh diff --git a/docker/docker_tests.sh b/docker/docker_tests.sh new file mode 100644 index 0000000000..8f88919e2d --- /dev/null +++ b/docker/docker_tests.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +$(tomo --help | grep -q tomo)