Created
October 1, 2020 15:44
-
-
Save akozlenkov/177f74f70a272a9ff53ad1004fd2f51f to your computer and use it in GitHub Desktop.
wb rules emu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| version: '3' | |
| services: | |
| wb-rules: | |
| build: . | |
| volumes: | |
| - "./rules:/rules" | |
| command: /bin/wb-rules -broker "tcp://mosquitto:1883" /rules | |
| links: | |
| - "mosquitto" | |
| mosquitto: | |
| image: "eclipse-mosquitto" | |
| ports: | |
| - "1883:1883" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:bionic as golang | |
| RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:masterminds/glide && \ | |
| apt-get update && apt-get install -y gcc git wget unzip glide && apt-get clean | |
| RUN wget -qO- https://golang.org/dl/go1.15.linux-amd64.tar.gz | tar xvz -C /usr/local && export PATH=$PATH:/usr/local/bin | |
| ENV PATH="/usr/local/go/bin:${PATH}" | |
| FROM golang as builder | |
| RUN mkdir -p /root/go/src/github.com/contactless | |
| WORKDIR /root/go/src/github.com/contactless | |
| RUN git clone https://github.com/wirenboard/wbgo.git && cd wbgo && git checkout tags/0.0.6 | |
| WORKDIR /root/go/src/github.com/contactless | |
| RUN git clone https://github.com/wirenboard/wb-rules.git && cd wb-rules && git checkout tags/1.6.7 && glide install && go build | |
| FROM ubuntu:bionic | |
| COPY --from=builder /root/go/src/github.com/contactless/wb-rules/wb-rules /bin/ | |
| COPY --from=builder /root/go/src/github.com/contactless/wb-rules/scripts/lib.js /scripts/ | |
| CMD ["/bin/wb-rules"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment