storj/cmd/hc/Dockerfile
Matt Robinson 5841065420 Attempt to fix jenkins builds (#260)
* Attempt to clean up docker image tags

* Clean only master

* Add back go version and actually use it
2018-08-21 22:54:56 -04:00

27 lines
772 B
Docker

ARG GO_VERSION=1.10
FROM golang:${GO_VERSION}-alpine AS build-env
RUN apk update && \
apk upgrade && \
apk add curl && \
apk add git
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
RUN cd /go/src/storj.io/storj/cmd/hc && go build -o hc
# final stage
FROM alpine
ENV REDIS_ADDRESS= \
REDIS_PASSWORD= \
REDIS_DB=0 \
OVERLAY_PORT=7070 \
HTTP_PORT=8080
WORKDIR /app
COPY --from=build-env /go/src/storj.io/storj/cmd/hc/hc /app/
EXPOSE 8081/udp \
8080 \
7070
ENTRYPOINT ./hc run --overlay.database-url redis://:${REDIS_PASSWORD}@${REDIS_ADDRESS}/?db=${REDIS_DB} --debug.addr=${HTTP_PORT} --identity.address=${OVERLAY_PORT}