Skip to content

Commit

Permalink
PPROF debug version added to kubearmor
Browse files Browse the repository at this point in the history
Signed-off-by: PrimalPimmy <[email protected]>
  • Loading branch information
PrimalPimmy committed Nov 5, 2023
1 parent 42dda46 commit d267d69
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
14 changes: 13 additions & 1 deletion KubeArmor/build/build_kubearmor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if [ ! -z $1 ]; then
VERSION=$1
fi


export DOCKER_BUILDKIT=1

# remove old images
Expand All @@ -47,7 +48,7 @@ unset LABEL
# build a kubearmor image
DTAG="-t $REPO:$VERSION"
echo "[INFO] Building $DTAG"
cd $ARMOR_HOME/..; docker build $DTAG -f Dockerfile --target kubearmor . $LABEL
cd $ARMOR_HOME/..; docker build $DTAG -f Dockerfile --target kubearmor . $LABEL -e ENABLE_PPROF=false

if [ $? != 0 ]; then
echo "[FAILED] Failed to build $REPO:$VERSION"
Expand All @@ -66,6 +67,17 @@ if [ $? != 0 ]; then
fi
echo "[PASSED] Built $REPO-init:$VERSION"

# build a debug kubearmor image
DTAG="-t $REPO:$VERSION" + "-debug"
echo "[INFO] Building $DTAG"
cd $ARMOR_HOME/..; docker build $DTAG -f Dockerfile --target kubearmor . $LABEL -e ENABLE_PPROF=$ENABLE_PPROF

if [ $? != 0 ]; then
echo "[FAILED] Failed to build $REPO:$VERSION-debug"
exit 1
fi
echo "[PASSED] Built $REPO:$VERSION-debug"

# build a kubearmor-ubi image
DTAGUBI="-t $UBIREPO:$VERSION"
echo "[INFO] Building $UBIREPO"
Expand Down
8 changes: 8 additions & 0 deletions KubeArmor/build/push_kubearmor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ cd $ARMOR_HOME/..; docker buildx build --metadata-file kubearmor-init.json --pla
[[ $? -ne 0 ]] && echo "[FAILED] Failed to push $REPO-init:$VERSION" && exit 1
echo "[PASSED] Pushed $REPO-init:$VERSION"

# push $REPO:$VERSION-debug
DTAG="-t $REPO:$VERSION" + "-debug"
echo "[INFO] Pushing $REPO:$VERSION-debug"
cd $ARMOR_HOME/..; docker buildx build --metadata-file kubearmor.json --platform $PLATFORMS $DTAG -f Dockerfile --push $LABEL $STABEL_LABEL .

[[ $? -ne 0 ]] && echo "[FAILED] Failed to push $REPO:$VERSION-debug" && exit 1
echo "[PASSED] Pushed $REPO:$VERSION-debug"

# push $UBIREPO
echo "[INFO] Pushing $UBIREPO:$VERSION"
cd $ARMOR_HOME/..; docker buildx build --metadata-file kubearmor-ubi.json --platform $PLATFORMS --build-arg VERSION=$VERSION --target kubearmor-ubi -t $UBIREPO:$VERSION -f Dockerfile --push $LABEL $STABEL_LABEL .
Expand Down

0 comments on commit d267d69

Please sign in to comment.