FROM golang:1.13.10 AS builder

COPY . /go/kuiper

WORKDIR /go/kuiper

RUN apt update && apt install -y upx pkg-config libczmq-dev && make build_with_edgex

FROM debian:10

COPY --from=builder /go/kuiper/_build/kuiper-* /kuiper/
COPY ./deploy/docker/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh

RUN apt update && apt install -y pkg-config libczmq-dev

WORKDIR /kuiper

EXPOSE 9081 20498

ENV KUIPER_HOME /kuiper

ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]

CMD ["./bin/server"]