mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-28 05:13:46 +00:00
update dockerfile for debug
This commit is contained in:
parent
17ecaece3e
commit
5dfc15b140
@ -3,11 +3,12 @@ FROM node:14-slim AS site-build
|
|||||||
|
|
||||||
WORKDIR /app/ui-build
|
WORKDIR /app/ui-build
|
||||||
|
|
||||||
COPY ui .
|
COPY ui/package.json .
|
||||||
|
COPY ui/package-lock.json .
|
||||||
RUN npm i
|
RUN npm i
|
||||||
|
COPY ui .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
FROM golang:1.16-alpine AS builder
|
FROM golang:1.16-alpine AS builder
|
||||||
# Set necessary environment variables needed for our image.
|
# Set necessary environment variables needed for our image.
|
||||||
ENV CGO_ENABLED=1 GOOS=linux GOARCH=amd64
|
ENV CGO_ENABLED=1 GOOS=linux GOARCH=amd64
|
||||||
@ -34,6 +35,7 @@ ARG SEM_VER=0.0.0
|
|||||||
COPY shared ../shared
|
COPY shared ../shared
|
||||||
COPY tap ../tap
|
COPY tap ../tap
|
||||||
COPY agent .
|
COPY agent .
|
||||||
|
# Include gcflags for debugging
|
||||||
RUN go build -gcflags="all=-N -l" -o mizuagent .
|
RUN go build -gcflags="all=-N -l" -o mizuagent .
|
||||||
|
|
||||||
# Download Basenine executable, verify the sha1sum and move it to a directory in $PATH
|
# Download Basenine executable, verify the sha1sum and move it to a directory in $PATH
|
||||||
@ -45,10 +47,10 @@ RUN chmod +x ./basenine_linux_amd64
|
|||||||
COPY devops/build_extensions_debug.sh ..
|
COPY devops/build_extensions_debug.sh ..
|
||||||
RUN cd .. && /bin/bash build_extensions_debug.sh
|
RUN cd .. && /bin/bash build_extensions_debug.sh
|
||||||
|
|
||||||
|
|
||||||
FROM golang:1.16-alpine
|
FROM golang:1.16-alpine
|
||||||
|
|
||||||
RUN apk add bash libpcap-dev
|
# Set necessary environment variables needed for our image.
|
||||||
|
RUN apk add bash libpcap-dev gcc g++
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -57,9 +59,16 @@ COPY --from=builder ["/app/agent-build/mizuagent", "."]
|
|||||||
COPY --from=builder ["/app/agent-build/basenine_linux_amd64", "/usr/local/bin/basenine"]
|
COPY --from=builder ["/app/agent-build/basenine_linux_amd64", "/usr/local/bin/basenine"]
|
||||||
COPY --from=builder ["/app/agent/build/extensions", "extensions"]
|
COPY --from=builder ["/app/agent/build/extensions", "extensions"]
|
||||||
COPY --from=site-build ["/app/ui-build/build", "site"]
|
COPY --from=site-build ["/app/ui-build/build", "site"]
|
||||||
|
RUN mkdir /app/data/
|
||||||
|
|
||||||
# install remote debugging tool
|
# install delve
|
||||||
|
ENV CGO_ENABLED=1 GOOS=linux GOARCH=amd64
|
||||||
RUN go get github.com/go-delve/delve/cmd/dlv
|
RUN go get github.com/go-delve/delve/cmd/dlv
|
||||||
|
|
||||||
|
ENV GIN_MODE=debug
|
||||||
|
|
||||||
|
# delve ports
|
||||||
|
EXPOSE 2345 2346
|
||||||
|
|
||||||
|
# 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"
|
ENTRYPOINT "/app/mizuagent"
|
||||||
#CMD ["sh", "-c", "dlv --headless=true --listen=:2345 --log --api-version=2 --accept-multiclient exec ./mizuagent -- --api-server"]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user