Updated and improved Dockerfile

This commit is contained in:
Aldo Borrero González 2017-12-15 21:15:23 +01:00 committed by Julian Y
parent 9c753ed0c3
commit 6680a32b1c

View file

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