From 763088836e7d1ad63558a892614bb9dd4ed22588 Mon Sep 17 00:00:00 2001 From: ashpect Date: Mon, 8 Jul 2024 23:26:51 +0530 Subject: [PATCH 1/2] minor changes to ReadMe --- .gitignore | 3 ++- README.md | 24 +++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7c961ef..0d0b2c2 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ vendor/ # IDE properties .idea/ -.vscode/ \ No newline at end of file +.vscode/ +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 2aeda3e..8cf221f 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,24 @@ go build cmd/main.go ## Run ```sh -./main py node rb | buildctl build --output type=docker,name=imagename | docker load +./main runtime py node rb | buildctl build --output type=docker,name=imagename | docker load ``` +if you want to push the image to a registry, you can use the following command: + +```sh +./main runtime py node rb | buildctl build --output type=image,name=docker.io/ashpect/testimage,push=true +``` +After getting the llb, you can use various buildkit args to specify output + ## Run with buildctl-daemonless -Requirements: +#### Linux Requirements: - [BuildKit](https://github.com/moby/buildkit/releases) - [RootlessKit](https://github.com/rootless-containers/rootlesskit/releases) -MacOs: +#### MacOs: For MacOs, you can use install buildkit using brew and lima for rootless containers, and run the script after the installation. @@ -30,6 +37,17 @@ $ brew install buildkit $ brew install lima ``` +#### Using Docker: + +If you don't have buildkit installed, you can use the docker image to run the buildkit daemon. +```sh +docker run --rm --privileged -d --name buildkit moby/buildkit +``` +Export the environment variable `BUILDKIT_HOST` to point to the buildkit daemon. +```sh +export BUILDKIT_HOST=docker-container://buildkit +``` + ```sh ./main py node rb | ./hack/buildctl.sh build --output type=docker,name=imagename | docker load ``` From 50e8db3f62c0bc883d802f24d0e96b5807f93026 Mon Sep 17 00:00:00 2001 From: ashpect Date: Wed, 17 Jul 2024 14:06:11 +0530 Subject: [PATCH 2/2] bug fix, multiple node in runtime --- pkg/staging/helper.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/staging/helper.go b/pkg/staging/helper.go index a461b72..864474f 100644 --- a/pkg/staging/helper.go +++ b/pkg/staging/helper.go @@ -14,7 +14,15 @@ func validateArgs(args []string) (string, error) { if !ok { return "", errors.New("Invalid language: " + arg) } - cmdArgs = append(cmdArgs, lang) + isExists := false + for _, str := range cmdArgs { + if lang == str { + isExists = true + } + } + if !isExists { + cmdArgs = append(cmdArgs, lang) + } } return strings.Join(cmdArgs, " "), nil }