Merge pull request #47 from etienne-napoleone/docker

Docker for tomochain base image
This commit is contained in:
Tuna 2018-06-21 10:13:35 +07:00 committed by GitHub
commit 53e7336ae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 23 deletions

View file

@ -1,16 +1,19 @@
# Build Geth in a stock Go builder container
FROM golang:1.10-alpine as builder FROM golang:1.10-alpine as builder
RUN apk add --no-cache make gcc musl-dev linux-headers RUN apk add --no-cache make gcc musl-dev linux-headers
ADD . /go-ethereum ADD . /tomochain
RUN cd /go-ethereum && make geth RUN cd /tomochain && make tomo
# Pull Geth into a second stage deploy alpine container
FROM alpine:latest FROM alpine:latest
RUN apk add --no-cache ca-certificates LABEL maintainer="etienne@tomochain.com"
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
EXPOSE 8545 8546 30303 30303/udp 30304/udp COPY --from=builder /tomochain/build/bin/tomo /usr/local/bin/tomo
ENTRYPOINT ["geth"]
RUN chmod +x /usr/local/bin/tomo
EXPOSE 8545
EXPOSE 30303
ENTRYPOINT ["/usr/local/bin/tomo", "--help"]

View file

@ -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

11
docker-compose.test.yml Normal file
View file

@ -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

3
docker/docker_tests.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/sh
$(tomo --help | grep -q tomo)