Skip to content

Commit

Permalink
set LLBCaps
Browse files Browse the repository at this point in the history
  • Loading branch information
po3rin committed Jun 16, 2019
1 parent f1f7da2 commit e4d5e89
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ This uses Go WebAssembly + BuildKit package.
<img src="./static/sp.gif" width="80%">
</p>

## How to develop

```bash
## build wasm
make build

## run file server
make exec
```

## Go + WebAssembly
https://github.com/golang/go/wiki/WebAssembly

Expand Down
12 changes: 11 additions & 1 deletion docker2dot/docker2dot.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"

"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/client/llb/imagemetaresolver"
"github.com/moby/buildkit/solver/pb"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
Expand All @@ -16,7 +17,16 @@ import (

// Docker2Dot convert dockerfile to llb Expressed in DOT language.
func Docker2Dot(df []byte) ([]byte, error) {
st, img, err := dockerfile2llb.Dockerfile2LLB(context.Background(), df, dockerfile2llb.ConvertOpt{})
caps := pb.Caps.CapSet(pb.Caps.All())

st, img, err := dockerfile2llb.Dockerfile2LLB(
context.Background(),
df,
dockerfile2llb.ConvertOpt{
MetaResolver: imagemetaresolver.Default(),
LLBCaps: &caps,
},
)
if err != nil {
return nil, err
}
Expand Down
Binary file modified main.wasm
Binary file not shown.

0 comments on commit e4d5e89

Please sign in to comment.