mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-07-10 09:00:15 +00:00
* WIP * Update tap.go, provider.go, and 2 more files... * WIP * WIP * Solved routine hanging forever: Added missing flag when calling mizuagent. * Iterate channel with range. * Panic if har channel is nil or if websocket connection is nil. * StartPassiveTapper returns read only channel. * Solved program exiting immediately: Wait for interrupt signal instead of exiting. * Solve connecting issue - Retry a few times. * Use lib const instead of magic. * Nicer error prints. * Don't coninue piping message if there is an error. * Comment. * Dependency injection. * no message * Fixed comment. * Print tapped addresses when they are updated. * Print errors in cleanup if there are any. Co-authored-by: RamiBerm <rami.berman@up9.com> Co-authored-by: Roee Gadot <roee.gadot@up9.com>
42 lines
1.1 KiB
Docker
42 lines
1.1 KiB
Docker
FROM node:14-slim AS site-build
|
|
|
|
WORKDIR /ui-build
|
|
|
|
COPY ui .
|
|
RUN npm i
|
|
RUN npm run build
|
|
|
|
|
|
FROM golang:1.16-alpine AS builder
|
|
# Set necessary environment variables needed for our image.
|
|
ENV CGO_ENABLED=1 GOOS=linux GOARCH=amd64
|
|
|
|
RUN apk add libpcap-dev gcc g++ make
|
|
|
|
# Move to api working directory (/api-build).
|
|
WORKDIR /api-build
|
|
|
|
COPY api/go.mod api/go.sum ./
|
|
RUN go mod download
|
|
# cheap trick to make the build faster (As long as go.mod wasn't changes)
|
|
RUN go list -f '{{.Path}}@{{.Version}}' -m all | sed 1d | grep -e 'go-cache' -e 'sqlite' | xargs go get
|
|
|
|
# Copy and build api code
|
|
COPY api .
|
|
RUN go build -ldflags="-s -w" -o mizuagent .
|
|
|
|
|
|
FROM alpine:3.13.5
|
|
|
|
RUN apk add bash libpcap-dev tcpdump
|
|
WORKDIR /app
|
|
|
|
# Copy binary and config files from /build to root folder of scratch container.
|
|
COPY --from=builder ["/api-build/mizuagent", "."]
|
|
COPY --from=site-build ["/ui-build/build", "site"]
|
|
|
|
COPY api/start.sh .
|
|
|
|
# this script runs both apiserver and passivetapper and exits either if one of them exits, preventing a scenario where the container runs without one process
|
|
ENTRYPOINT "/app/mizuagent"
|