Dockerfile 956 B

123456789101112131415161718192021
  1. FROM golang:1.10-alpine3.7
  2. # add china aliyun repo 新增了 alpine 3.6 的阿里源
  3. RUN cp /etc/apk/repositories /etc/apk/repositories.back && \
  4. echo "https://mirrors.aliyun.com/alpine/v3.6/main/" > /etc/apk/repositories && \
  5. echo "https://mirrors.aliyun.com/alpine/v3.6/community/" >> /etc/apk/repositories
  6. RUN apk add --update bash git make gcc g++
  7. ADD . /go/src/github.com/lifei6671/mindoc
  8. WORKDIR /go/src/github.com/lifei6671/mindoc
  9. RUN chmod +x start.sh
  10. RUN go get -u github.com/golang/dep/cmd/dep && dep ensure && \
  11. 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`'" && \
  12. 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
  13. CMD ["./start.sh"]