2018-08-31 16:21:44 +01:00
|
|
|
ARG GO_VERSION=1.11
|
2018-08-22 03:54:56 +01:00
|
|
|
FROM golang:${GO_VERSION}-alpine AS build-env
|
2018-08-31 16:21:44 +01:00
|
|
|
ARG GOOS=linux
|
|
|
|
ARG GOARCH=amd64
|
|
|
|
ARG LDFLAGS=
|
2018-08-22 03:54:56 +01:00
|
|
|
RUN apk add -U curl git musl-dev gcc
|
2018-07-19 20:42:50 +01:00
|
|
|
COPY . /go/src/storj.io/storj
|
2018-08-31 16:21:44 +01:00
|
|
|
ENV GOOS=${GOOS} \
|
|
|
|
GOARCH=${GOARCH} \
|
|
|
|
LDFLAGS=${LDFLAGS} \
|
|
|
|
GOARM=6 \
|
|
|
|
CGO_ENABLED=0 \
|
|
|
|
GO111MODULE=on
|
|
|
|
RUN cd /go/src/storj.io/storj/cmd/storagenode \
|
|
|
|
&& go build -o storagenode -ldflags "-s -w $LDFLAGS"
|
|
|
|
|
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-25 02:52:58 +01:00
|
|
|
COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/storagenode /app/
|
|
|
|
COPY cmd/storagenode/entrypoint /entrypoint
|
2018-08-23 16:48:03 +01:00
|
|
|
ENTRYPOINT ["/entrypoint"]
|