2017-12-12 14:41:01 +03:00
|
|
|
FROM golang:alpine AS build-env
|
2017-12-29 17:12:17 -05:00
|
|
|
LABEL maintainer "Jimmy Zelinskie <jimmyzelinskie+git@gmail.com>"
|
2016-09-05 18:18:29 -04:00
|
|
|
|
2016-09-21 15:26:21 -04:00
|
|
|
# Install OS-level dependencies.
|
|
|
|
RUN apk update && \
|
2017-12-29 17:12:17 -05:00
|
|
|
apk add curl git
|
2016-09-05 18:18:29 -04:00
|
|
|
|
2016-09-21 15:26:21 -04:00
|
|
|
# Copy our source code into the container.
|
2016-09-05 18:18:29 -04:00
|
|
|
WORKDIR /go/src/github.com/chihaya/chihaya
|
2017-12-12 14:41:01 +03:00
|
|
|
COPY . /go/src/github.com/chihaya/chihaya
|
2016-09-21 15:26:21 -04:00
|
|
|
|
|
|
|
# Install our golang dependencies and compile our binary.
|
2017-12-29 17:12:17 -05:00
|
|
|
RUN go get -u github.com/golang/dep/...
|
|
|
|
RUN dep ensure
|
|
|
|
RUN CGO_ENABLED=0 go install github.com/chihaya/chihaya/cmd/...
|
2016-09-05 18:18:29 -04:00
|
|
|
|
2017-12-20 14:51:11 +03:00
|
|
|
FROM alpine:latest
|
2017-12-12 14:41:01 +03:00
|
|
|
COPY --from=build-env /go/bin/chihaya /chihaya
|
2017-12-20 14:51:11 +03:00
|
|
|
|
|
|
|
RUN adduser -D chihaya
|
2016-10-21 23:00:20 -04:00
|
|
|
|
2016-09-21 15:26:21 -04:00
|
|
|
# Expose a docker interface to our binary.
|
2016-09-05 18:18:29 -04:00
|
|
|
EXPOSE 6880 6881
|
2017-12-12 14:41:01 +03:00
|
|
|
|
|
|
|
# Drop root privileges
|
|
|
|
USER chihaya
|
|
|
|
|
|
|
|
ENTRYPOINT ["/chihaya"]
|