mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-24 15:24:17 +00:00
Add database to Dockerfile
This commit is contained in:
parent
e15a344f1d
commit
ad5fd161ec
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "realtime_dbms"]
|
||||
path = realtime_dbms
|
||||
url = https://github.com/mertyildiran/simple-realtime-dbms
|
@ -42,6 +42,9 @@ RUN go build -ldflags="-s -w \
|
||||
COPY build_extensions.sh ..
|
||||
RUN cd .. && /bin/bash build_extensions.sh
|
||||
|
||||
COPY realtime_dbms ../realtime_dbms
|
||||
RUN cd ../realtime_dbms/server && go build -o server server.go
|
||||
|
||||
FROM alpine:3.13.5
|
||||
|
||||
RUN apk add bash libpcap-dev tcpdump
|
||||
@ -49,6 +52,7 @@ WORKDIR /app
|
||||
|
||||
# Copy binary and config files from /build to root folder of scratch container.
|
||||
COPY --from=builder ["/app/agent-build/mizuagent", "."]
|
||||
COPY --from=builder ["/app/realtime_dbms/server", "."]
|
||||
COPY --from=builder ["/app/agent/build/extensions", "extensions"]
|
||||
COPY --from=site-build ["/app/ui-build/build", "site"]
|
||||
|
||||
|
5
Makefile
5
Makefile
@ -34,6 +34,7 @@ build-cli-ci: ## Build CLI for CI.
|
||||
agent: ## Build agent.
|
||||
@(echo "building mizu agent .." )
|
||||
@(cd agent; go build -o build/mizuagent main.go)
|
||||
${MAKE} database
|
||||
${MAKE} extensions
|
||||
@ls -l agent/build
|
||||
|
||||
@ -72,6 +73,10 @@ clean-cli: ## Clean CLI.
|
||||
clean-docker:
|
||||
@(echo "DOCKER cleanup - NOT IMPLEMENTED YET " )
|
||||
|
||||
database:
|
||||
@(echo "building database .." )
|
||||
@(cd realtime_dbms/server; go build -o ../../agent/build/server server.go)
|
||||
|
||||
extensions:
|
||||
./build_extensions.sh
|
||||
|
||||
|
@ -13,12 +13,14 @@ import (
|
||||
"mizuserver/pkg/utils"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"plugin"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-contrib/static"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -84,6 +86,19 @@ func main() {
|
||||
go pipeTapChannelToSocket(socketConnection, filteredOutputItemsChannel)
|
||||
// go pipeOutboundLinksChannelToSocket(socketConnection, outboundLinkOutputChannel)
|
||||
} else if *apiServerMode {
|
||||
ex, err := os.Executable()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
dir := path.Dir(ex)
|
||||
cmd := exec.Command(filepath.Join(dir, "./server"), "-port", "8000")
|
||||
cmd.Stdout = os.Stdout
|
||||
err = cmd.Start()
|
||||
time.Sleep(1 * time.Second)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
api.StartResolving(*namespace)
|
||||
|
||||
outputItemsChannel := make(chan *tapApi.OutputChannelItem)
|
||||
|
1
realtime_dbms
Submodule
1
realtime_dbms
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit b86f10916f930db10c2f667f939f13a8743ef404
|
Loading…
Reference in New Issue
Block a user