-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
24 lines (19 loc) · 913 Bytes
/
Dockerfile
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 golang:1.20.4 as plugin
ENV GOPROXY="https://goproxy.cn,direct"
WORKDIR /workspace
COPY plugins/cloudevents/ /workspace/
RUN unset HTTPS_PROXY;unset HTTP_PROXY;unset http_proxy;unset https_proxy; go mod tidy -v && \
go build -buildmode=plugin -o cloudevents.so main.go
FROM golang:1.20.4 as builder
ENV GOPROXY="https://goproxy.cn,direct"
WORKDIR /workspace
COPY . /workspace/
RUN unset HTTPS_PROXY;unset HTTP_PROXY;unset http_proxy;unset https_proxy;go mod download
RUN unset HTTPS_PROXY;unset HTTP_PROXY;unset http_proxy;unset https_proxy;go get github.com/stream-stack/common
RUN unset HTTPS_PROXY;unset HTTP_PROXY;unset http_proxy;unset https_proxy;go build -o dispatcher cmd/main.go
FROM ubuntu:latest
WORKDIR /
COPY --from=builder /workspace/dispatcher .
RUN mkdir -p ./plugins/cloudevents
COPY --from=plugin /workspace/cloudevents.so ./plugins/cloudevents/cloudevents.so
CMD ["./dispatcher"]