llb2dot package lets you to convert BuildKit LLB to dot language to analize. You also can directly load Dockerfile.
from here https://github.com/po3rin/llb2dot/releases
go get
occurs unexpected error during the installation...
#1
convert llb to dot language using Dockerfile.
$ lb2dot -f ./Dockerfile
vizualize llb using dot cli.
$ llb2dot -f ./Dockerfile | dot -T png -o result.png
also, you directory generate dot language from llb using l flag.
$ go run cmd/_testplainllb/main.go | llb2dot -l
As code
package main
import (
"os"
"github.com/po3rin/llb2dot"
)
func main(){
// load llb (you want to load from Dockerfile? use LoadDockerfile)
ops, _ := llb2dot.LoadLLB(os.Stdin)
// convert graph
g, _ := llb2dot.LLB2Graph(ops)
// write graph as dot language
llb2dot.WriteDOT(os.Stdout, g)
}
You're most welcomed! Welcome pull request and issues.