Skip to content

Instantly share code, notes, and snippets.

@akozlenkov
Created October 1, 2020 15:44
Show Gist options
  • Select an option

  • Save akozlenkov/177f74f70a272a9ff53ad1004fd2f51f to your computer and use it in GitHub Desktop.

Select an option

Save akozlenkov/177f74f70a272a9ff53ad1004fd2f51f to your computer and use it in GitHub Desktop.
wb rules emu
---
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"
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