forked from cnosdb/cnosdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_data
24 lines (18 loc) · 780 Bytes
/
Dockerfile_data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM --platform=$BUILDPLATFORM golang:1.17.5 as builder
ARG TARGETARCH
WORKDIR /go/src/github.com/cnosdatabase/cnosdb
COPY . /go/src/github.com/cnosdatabase/cnosdb
# Proxy, You know.
# RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN GOOS=linux GOARCH=$TARGETARCH go install ./...
FROM debian:stretch
COPY --from=builder /go/bin/cnosdb /usr/bin/cnosdb-data
COPY --from=builder /go/bin/cnosdb-cli /usr/bin/
COPY --from=builder /go/src/github.com/cnosdatabase/cnosdb/etc/cnosdb.sample.toml /etc/cnosdb/cnosdb-data.conf
EXPOSE 8086
VOLUME /var/lib/cnosdb
COPY docker/entrypoint.sh /entrypoint.sh
COPY docker/init-cnosdb.sh /init-cnosdb.sh
RUN chmod +x /entrypoint.sh /init-cnosdb.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["cnosdb-data","--config","/etc/cnosdb/cnosdb-data.conf"]