From 6680a32b1c242a11917ab99698d34a1cb4ec14fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aldo=20Borrero=20Gonza=CC=81lez?= Date: Fri, 15 Dec 2017 21:15:23 +0100 Subject: [PATCH] Updated and improved Dockerfile --- Dockerfile | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e38b7f297..c1b78ad6cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,27 @@ -FROM alpine:3.5 +# Use Alpine Linux +FROM golang:1.9-alpine as builder -ADD . /go-ubiq -RUN \ - apk add --update git go make gcc musl-dev linux-headers && \ - (cd go-ubiq && make gubiq) && \ - cp go-ubiq/build/bin/gubiq /gubiq && \ - apk del git go make gcc musl-dev linux-headers && \ - rm -rf /go-ubiq && rm -rf /var/cache/apk/* +# Install basic dependencies +RUN apk update +RUN apk add --no-cache wget +RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub -EXPOSE 8588 -EXPOSE 30388 +# Add glibc dependency as previous to 1.6 Geth needs it in order to compile and work properly +RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk +RUN apk add --no-cache make gcc musl-dev linux-headers git glibc-2.25-r0.apk -ENTRYPOINT ["/gubiq"] +# Fetch Gubiq source and build it +RUN git clone https://github.com/ubiq/go-ubiq go-ubiq/ +RUN cd go-ubiq && make gubiq + +# Pull Gubiq into another container +FROM alpine:latest + +RUN apk add --no-cache ca-certificates +COPY --from=builder /go/go-ubiq/build/bin/gubiq /usr/local/bin/ + +# Expose ports +EXPOSE 8588 8588 + +# Entry point +ENTRYPOINT ["gubiq"] \ No newline at end of file