Skip to content

Commit

Permalink
Add demo (docker)
Browse files Browse the repository at this point in the history
  • Loading branch information
keesverruijt committed Aug 26, 2024
1 parent d07cd13 commit cbfe6a2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
35 changes: 35 additions & 0 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# docker buildx build --tag keesverruijt/mayara-demo:latest .
#
# docker buildx build --platform linux/arm64,linux/amd64 --tag keesverruijt/mayara-demo:latest --push .
#

FROM wdantuma/signalk-radar-demo:latest AS build

RUN apk add --no-cache git curl bash g++

WORKDIR /src

RUN curl -sSf https://sh.rustup.rs | bash -s -- -y

ENV PATH="/root/.cargo/bin:${PATH}"

RUN git clone https://github.com/keesverruijt/mayara.git && \
cd mayara && cargo build --release

FROM wdantuma/signalk-radar-demo:latest

RUN apk add --no-cache tcpreplay curl unzip

WORKDIR /app

COPY start.sh .
COPY samples/halo_and_0183.pcap .

RUN chmod +x start.sh

COPY --from=build /src/mayara/target/release/mayara /app/mayara

RUN apk add strace tcpdump

CMD [ "/app/start.sh"]
Binary file added demo/samples/halo_and_0183.pcap
Binary file not shown.
4 changes: 4 additions & 0 deletions demo/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
./mayara -i lo -p 3001 --replay &
signalk-server/bin/signalk-server -c signalk/ &
tcpreplay -q -T select -l 0 -i lo /app/halo_and_0183.pcap

0 comments on commit cbfe6a2

Please sign in to comment.