Skip to content

Commit

Permalink
Merge pull request #25 from ashpect/master
Browse files Browse the repository at this point in the history
Bug fix +  ReadMe updates
  • Loading branch information
viferga authored Jul 22, 2024
2 parents 28d9ec8 + 50e8db3 commit 2e4b3b0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
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

0 comments on commit 2e4b3b0

Please sign in to comment.