fix docker build in production.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-05-04 15:32:51 +08:00
parent 25a152b533
commit c0e3a871d6
4 changed files with 9 additions and 8 deletions

View File

@@ -2,11 +2,12 @@ FROM golang:1.6-alpine
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
RUN apk --update add git
RUN mkdir -p /tmp/build
Add build.tar.gz /tmp/build/
WORKDIR /tmp/build
RUN go get -v -d
RUN apk --update add git make
RUN go get github.com/Masterminds/glide && cd $GOPATH/src/github.com/Masterminds/glide && make install
RUN mkdir -p $GOPATH/src/github.com/appleboy/gorush
Add build.tar.gz $GOPATH/src/github.com/appleboy/gorush/
WORKDIR $GOPATH/src/github.com/appleboy/gorush
RUN make bundle
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/gorush gorush.go
CMD tar -C bin -czf - gorush

View File

@@ -8,7 +8,7 @@ RUN apk update && apk upgrade \
RUN mkdir /app
ADD gorush.tar.gz /app/
ADD config/config.yml /app/config
ADD config/config.yml /app/config/
WORKDIR /app
ENTRYPOINT ["./gorush", "-c", "config/config.yml"]
EXPOSE 8088