加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 708 Bytes
一键复制 编辑 原始数据 按行查看 历史
Dalf 提交于 2020-07-18 12:13 . Dockerfile: upgrade
# STEP 1 build executable binary
FROM golang:1.14-alpine as builder
WORKDIR $GOPATH/src/github.com/asciimoo/filtron
# add gcc musl-dev for "go test"
RUN apk add --no-cache git
COPY . .
RUN go get -d -v
RUN gofmt -l ./
# RUN go vet -v ./...
# RUN go test -v ./...
RUN go build .
# STEP 2 build the image including only the binary
FROM alpine:3.12
EXPOSE 3000
RUN apk --no-cache add ca-certificates \
&& adduser -D -h /usr/local/filtron -s /bin/false filtron filtron
COPY configs/rules.json /etc/filtron/rules.json
COPY --from=builder /go/src/github.com/asciimoo/filtron/filtron /usr/local/filtron/filtron
USER filtron
ENTRYPOINT ["/usr/local/filtron/filtron", "--rules", "/etc/filtron/rules.json"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化