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=
|
|
|
|
RUN apk add -U curl git musl-dev gcc
|
2018-06-21 20:36:39 +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/satellite \
|
|
|
|
&& go build -o satellite -ldflags "-s -w $LDFLAGS"
|
2018-06-05 22:06:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
# final stage
|
|
|
|
FROM alpine
|
2018-08-23 16:48:03 +01:00
|
|
|
ENV REDIS_ADDR=redis:6379 \
|
2018-07-02 20:18:28 +01:00
|
|
|
REDIS_PASSWORD= \
|
|
|
|
REDIS_DB=0 \
|
2018-08-23 16:48:03 +01:00
|
|
|
IDENTITY_ADDR=:7777 \
|
|
|
|
HTTP_PORT=:8080 \
|
|
|
|
BOOTSTRAP_ADDR=bootstrap.storj.io:8080
|
2018-06-05 22:06:37 +01:00
|
|
|
WORKDIR /app
|
2018-08-29 19:32:41 +01:00
|
|
|
COPY --from=build-env /go/src/storj.io/storj/cmd/satellite/satellite /app/
|
|
|
|
COPY cmd/satellite/entrypoint /entrypoint
|
2018-07-02 20:18:28 +01:00
|
|
|
EXPOSE 8081/udp \
|
|
|
|
8080 \
|
|
|
|
7070
|
2018-06-05 22:06:37 +01:00
|
|
|
|
2018-08-23 16:48:03 +01:00
|
|
|
ENTRYPOINT ["/entrypoint"]
|