From c635d04c53d2ceb0a094a16e585ba1d5ad4bf917 Mon Sep 17 00:00:00 2001 From: Sayan Samanta Date: Mon, 7 Jul 2025 12:27:09 -0700 Subject: [PATCH 1/2] local docker build --- shared/build-server.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/shared/build-server.sh b/shared/build-server.sh index e4fa84cd..dddfdcb0 100644 --- a/shared/build-server.sh +++ b/shared/build-server.sh @@ -25,9 +25,17 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" # 1. Build the binary in the server module -pushd "$REPO_ROOT/server" >/dev/null -GOOS="$TARGET_OS" GOARCH="$TARGET_ARCH" CGO_ENABLED=0 make build -popd >/dev/null +GO_REQUIRED=$(grep -E "^go [0-9]+\.[0-9]+" "$REPO_ROOT/server/go.mod" | head -n1 | awk '{print $2}') +echo "🔨 Building kernel-images-api binary using go ${GO_REQUIRED}" +docker run --rm \ + -e GOOS="$TARGET_OS" \ + -e GOARCH="$TARGET_ARCH" \ + -e CGO_ENABLED=0 \ + -e GOFLAGS="-buildvcs=false" \ + -v "$REPO_ROOT":/workspace \ + -w /workspace/server \ + "golang:${GO_REQUIRED}" \ + make build # 2. Copy to destination mkdir -p "$DEST_DIR" From de8be786ced9142f829d4066b21308be9cf5caea Mon Sep 17 00:00:00 2001 From: Sayan Samanta Date: Mon, 7 Jul 2025 12:56:43 -0700 Subject: [PATCH 2/2] opt build step --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index fa3fa614..9230297f 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,6 @@ You can build and run the Dockerfile directly as a Docker container. ```sh cd images/chromium-headful -../../shared/build-server.sh bin IMAGE=kernel-docker ./build-docker.sh IMAGE=kernel-docker ENABLE_WEBRTC=true ./run-docker.sh ``` @@ -163,4 +162,4 @@ For issues, questions, or feedback, please [open an issue](https://github.com/on - Thank you to [xonkernel](https://github.com/xonkernel) for leading the development of our WebRTC live view. - Thank you to the [Unikraft Cloud](https://unikraft.cloud/) team for your help with unikernels. -Made with ❤️ by the [Kernel team](https://www.onkernel.com). \ No newline at end of file +Made with ❤️ by the [Kernel team](https://www.onkernel.com).