2018-07-19 20:42:50 +01:00
|
|
|
# build
|
2018-08-22 03:54:56 +01:00
|
|
|
ARG GO_VERSION=1.10
|
|
|
|
FROM golang:${GO_VERSION}-alpine AS build-env
|
|
|
|
RUN apk add -U curl git musl-dev gcc
|
2018-07-19 20:42:50 +01:00
|
|
|
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
|
|
COPY . /go/src/storj.io/storj
|
|
|
|
RUN cd /go/src/storj.io/storj && dep ensure -vendor-only
|
2018-08-15 19:49:30 +01:00
|
|
|
RUN cd /go/src/storj.io/storj/cmd/farmer && go build -o farmer
|
2018-07-19 20:42:50 +01:00
|
|
|
|
|
|
|
# final stage
|
|
|
|
FROM alpine
|
2018-08-23 16:48:03 +01:00
|
|
|
ENV CONF_PATH= \
|
|
|
|
SATELLITE_ADDR=
|
|
|
|
EXPOSE 7777
|
2018-07-19 20:42:50 +01:00
|
|
|
|
|
|
|
WORKDIR /app
|
2018-08-15 19:49:30 +01:00
|
|
|
COPY --from=build-env /go/src/storj.io/storj/cmd/farmer/farmer /app/
|
2018-08-23 16:48:03 +01:00
|
|
|
COPY cmd/farmer/entrypoint /entrypoint
|
|
|
|
ENTRYPOINT ["/entrypoint"]
|