* Initial refactor Signed-off-by: Craig Box <craigb@armosec.io> * Initial refactor. Signed-off-by: Craig Box <craigb@armosec.io> * Now how did that get in there? Signed-off-by: Craig Box <craigb@armosec.io> * small fixes Signed-off-by: Craig Box <craigb@armosec.io> * Use GitHub note and warning syntax Signed-off-by: Craig Box <craigb@armosec.io> * second guessing thing with no docs Signed-off-by: Craig Box <craigb@armosec.io> * Final changes Signed-off-by: Craig Box <craigb@armosec.io> Signed-off-by: Craig Box <craigb@armosec.io>
2.3 KiB
Building Kubescape
Build on Windows
-
Install MSYS2 & build libgit (needed only for the first time)
build.bat all
Note
You can install MSYS2 separately by runningbuild.bat installand build libgit2 separately by runningbuild.bat build
-
Build kubescape
make buildOR
go build -tags=static .
Build on Linux/MacOS
-
Install libgit2 dependency (needed only for the first time)
make libgit2
Note
cmakeis required to build libgit2. You can install it by runningsudo apt-get install cmake(Linux) orbrew install cmake(macOS).
-
Build kubescape
make buildOR
go build -tags=static . -
Test
make test
Build Kubescape in a pre-configured playground
We have created a Killercoda scenario that you can use to experiment building Kubescape from source.
When you start the scenario, a script will clone the Kubescape repository and execute a Linux build steps. The entire process executes multiple commands in order: it takes around 5-6 minutes to complete.
How to use the build playground:
- Apply changes you wish to make to the Kubescape source code.
- Perform a Linux build
- Now, you can use Kubescape like normal, but instead of using
kubescape, use./kubescape.
VS Code configuration samples
You can use the sample files below to setup your VS Code environment for building and debugging purposes.
.vscode/settings.json:
// .vscode/settings.json
{
"go.testTags": "static",
"go.buildTags": "static",
"go.toolsEnvVars": {
"CGO_ENABLED": "1"
}
}
.vscode/launch.json:
// .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"args": [
"scan",
"--logger",
"debug"
],
"buildFlags": "-tags=static"
}
]
}