Skip to content

Commit

Permalink
Custom dockerfile for traffic mirroring (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
AHarmlessPyro committed Mar 5, 2023
1 parent cfe7356 commit cc4523f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-gopcap-on-new-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
push: false
context: .
file: ./deploy/metlo-daemon-agent/Dockerfile
file: ./deploy/govxlan/Dockerfile
tags: metlo/agent:local
- name: Extract binaries
run: |
Expand Down
34 changes: 34 additions & 0 deletions deploy/govxlan/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM --platform=linux/amd64 rust:buster AS rust-builder
ENV RUSTFLAGS="-C target-feature=-crt-static"

RUN apt update
RUN apt install musl-dev g++ gcc bash autoconf automake libtool make python3 protobuf-compiler clang libclang-dev -y

WORKDIR /app
COPY ../../ingestors/rust-common/ rust-common
RUN cd rust-common && cargo build --release
RUN mv rust-common/target/release/metlo-agent metlo-agent

FROM --platform=linux/amd64 golang:buster AS go-builder

RUN apt update
RUN apt install libpcap-dev gcc g++ -y

WORKDIR /app

COPY ../../ingestors/govxlan/ govxlan
COPY ../../ingestors/rust-common/ rust-common
RUN cd govxlan && go build -o metlo-pcap
RUN mv govxlan/metlo-pcap metlo-pcap

FROM --platform=linux/amd64 debian:buster

RUN apt update
RUN apt install bash libpcap-dev gcc -y

WORKDIR /app
COPY ../../../deploy/metlo-daemon-agent/entrypoint.sh ./entrypoint.sh
COPY --from=go-builder /app/metlo-pcap ./metlo-pcap
COPY --from=rust-builder /app/metlo-agent ./metlo-agent

CMD ["/app/entrypoint.sh"]

0 comments on commit cc4523f

Please sign in to comment.