加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 974 Bytes
一键复制 编辑 原始数据 按行查看 历史
it-agent 提交于 2021-06-24 11:17 . 更新Dockerfile编译环境版本
FROM golang:1.16-alpine3.12 as builder
WORKDIR $GOPATH/src/github.com/feiyu563/PrometheusAlert
RUN apk update && apk upgrade && apk add --no-cache gcc g++ sqlite-libs
ENV GO111MODULE on
ENV GOPROXY https://goproxy.io
COPY . $GOPATH/src/github.com/feiyu563/PrometheusAlert
RUN go mod vendor && go build
# -----------------------------------------------------------------------------
FROM alpine:3.12
LABEL maintainer="jikun.zhang"
RUN apk update && apk upgrade && apk add --no-cache sqlite-libs
WORKDIR /app
COPY --from=builder /go/src/github.com/feiyu563/PrometheusAlert/PrometheusAlert .
COPY db/PrometheusAlertDB.db /opt/PrometheusAlertDB.db
COPY conf/app-example.conf conf/app.conf
COPY db db
COPY logs logs
COPY static static
COPY views views
#ENTRYPOINT [ "/app/PrometheusAlert" ]
CMD if [ ! -f /app/db/PrometheusAlertDB.db ];then cp /opt/PrometheusAlertDB.db /app/db/PrometheusAlertDB.db;echo 'init ok!';else echo 'pass!';fi && /app/PrometheusAlert
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化