storj/cmd/uplink/Dockerfile
Matt Robinson 0a78e741ec
Build and upload binaries (#296)
* First pass at building binaries

* Finished building images

* Reworked some bits to save binaries in a better place.

* First pass at uploading binaries

* Builds for freebsd fail currently

* Add ignore file for docker builds to not invalidate the cache as often

* Docker image for 1.11-alpine exists now

* Name windows binaries correctly

* The makefile is used in tests.

* Take a swing at updating the tests for 1.11

* Switch to something with glibc so the race detector works.

* Remove unused .PHONY targets
2018-08-31 11:21:44 -04:00

29 lines
615 B
Docker

ARG GO_VERSION=1.11
FROM golang:${GO_VERSION}-alpine AS build-env
ARG GOOS=linux
ARG GOARCH=amd64
ARG LDFLAGS=
RUN apk add -U curl git musl-dev gcc
COPY . /go/src/storj.io/storj
ENV GOOS=${GOOS} \
GOARCH=${GOARCH} \
LDFLAGS=${LDFLAGS} \
GOARM=6 \
CGO_ENABLED=0 \
GO111MODULE=on
RUN cd /go/src/storj.io/storj/cmd/uplink \
&& go build -o uplink -ldflags "-s -w $LDFLAGS"
# final stage
FROM alpine
ENV API_KEY= \
SATELLITE_ADDR=
EXPOSE 7777
WORKDIR /app
COPY --from=build-env /go/src/storj.io/storj/cmd/uplink/uplink /app/
COPY cmd/uplink/entrypoint /entrypoint
ENTRYPOINT ["/entrypoint"]