mindoc/Dockerfile

25 lines
1.1 KiB
Docker
Raw Normal View History

2018-07-11 10:25:27 +08:00
FROM golang:1.10.3-alpine3.7
# add china aliyun repo 新增了 alpine 3.6 的阿里源
2018-06-06 11:43:25 +08:00
RUN cp /etc/apk/repositories /etc/apk/repositories.back && \
echo "https://mirrors.aliyun.com/alpine/v3.6/main/" > /etc/apk/repositories && \
echo "https://mirrors.aliyun.com/alpine/v3.6/community/" >> /etc/apk/repositories
2017-06-21 18:10:16 +08:00
RUN apk add --update bash git make gcc g++
2017-05-01 13:11:33 +08:00
ADD . /go/src/github.com/lifei6671/mindoc
WORKDIR /go/src/github.com/lifei6671/mindoc
2018-06-06 11:43:25 +08:00
RUN go get -u github.com/golang/dep/cmd/dep && dep ensure && \
2018-02-03 17:22:50 +08:00
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`'" && \
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
2018-06-06 12:09:24 +08:00
FROM alpine:latest
2018-07-11 10:46:32 +08:00
LABEL maintainer="longfei6671@163.com"
2018-06-06 11:43:25 +08:00
WORKDIR /mindoc
COPY --from=0 /go/src/github.com/lifei6671/mindoc .
2018-06-27 15:10:01 +08:00
ENV ZONEINFO=/mindoc/lib/time/zoneinfo.zip
2018-06-06 11:43:25 +08:00
RUN chmod +x start.sh
2018-02-03 17:22:50 +08:00
CMD ["./start.sh"]