-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from linkernetworks/johnlin/mv-dockerfile
mv dockerfile Former-commit-id: 7b96877388dd1e1606cd84d9a2956be9832ad90b [formerly 3c8346b] Former-commit-id: 0d9025be8eaf83766cc083ba5e690703c6bc0ff5
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Build stage | ||
FROM golang:1.10-alpine3.7 | ||
MAINTAINER David Chang <[email protected]> | ||
# TODO fix path after move out | ||
WORKDIR /go/src/github.com/linkernetworks/vortex | ||
|
||
RUN apk add --no-cache protobuf ca-certificates git | ||
|
||
# TODO fix path after move out | ||
COPY src /go/src/github.com/linkernetworks/vortex/src | ||
COPY Makefile /go/src/github.com/linkernetworks/vortex | ||
COPY vendor /go/src/github.com/linkernetworks/vortex/vendor | ||
|
||
ENV CGO_ENABLED 0 | ||
ENV GOOS linux | ||
ENV TIMEZONE "Asia/Taipei" | ||
RUN apk add --no-cache tzdata && \ | ||
cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \ | ||
echo $TIMEZONE > /etc/timezone && \ | ||
apk del tzdata | ||
# TODO test go install | ||
RUN go get -x -u github.com/kardianos/govendor | ||
RUN govendor sync | ||
RUN go install ./src/cmd/... | ||
|
||
# the final image: vortex | ||
FROM alpine:3.7 | ||
RUN apk add --no-cache ca-certificates | ||
WORKDIR /vortex | ||
|
||
# copy the go binaries from the build image | ||
COPY --from=0 /go/bin /go/bin | ||
|
||
# copy the config files from the current working dir | ||
COPY config /vortex/config | ||
|
||
# select the config file for deployment | ||
ARG CONFIG=config/k8s.json | ||
COPY ${CONFIG} config/k8s.json | ||
|
||
EXPOSE 7890 | ||
ENTRYPOINT ["/go/bin/vortex", "-port", "7890", "-config", "/vortex/config/k8s.json"] |