Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix + ReadMe updates #25

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ vendor/

# IDE properties
.idea/
.vscode/
.vscode/
.DS_Store
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
```
Expand Down
10 changes: 9 additions & 1 deletion pkg/staging/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading