完善Dockerfile

pull/219/head
Minho 2018-02-03 17:22:50 +08:00
parent 2e90763493
commit 0a29049440
1 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
FROM golang:1.8.3-alpine3.6 FROM golang:1.9.3-alpine3.6
# add china aliyun repo 新增了 alpine 3.6 的阿里源 # add china aliyun repo 新增了 alpine 3.6 的阿里源
RUN cp /etc/apk/repositories /etc/apk/repositories.back && \ RUN cp /etc/apk/repositories /etc/apk/repositories.back && \
@ -13,7 +13,10 @@ WORKDIR /go/src/github.com/lifei6671/mindoc
RUN chmod +x start.sh RUN chmod +x start.sh
#RUN go get -d ./... && \ # 这行 docker build 不过去,所以注释掉了 RUN go get -d ./... && \
RUN go get github.com/mitchellh/gox && \ CGO_ENABLE=1 go build -v -o mindoc_linux_amd64 -ldflags="-w -X main.VERSION=$TAG -X 'main.BUILD_TIME=`date`' -X 'main.GO_VERSION=`go version`'" && \
gox -os "windows linux darwin" -arch amd64 rm -rf commands controllers models modules routers tasks vendor docs search data utils graphics .git Godeps uploads/* .gitignore .travis.yml Dockerfile gide.yaml LICENSE main.go README.md conf/enumerate.go conf/mail.go install.lock
WORKDIR /go/src/github.com/lifei6671/mindoc
CMD ["./start.sh"] CMD ["./start.sh"]