Skip to content
/ llb2dot Public

llb2dot package lets you to convert BuildKit LLB to dot language to analize. You can also directly load Dockerfile

Notifications You must be signed in to change notification settings

po3rin/llb2dot

Repository files navigation

llb2dot

CircleCI GolangCI

llb2dot package lets you to convert BuildKit LLB to dot language to analize. You also can directly load Dockerfile.

Installation

from here https://github.com/po3rin/llb2dot/releases

go get occurs unexpected error during the installation...
#1

Usage

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)
}

Contributing

You're most welcomed! Welcome pull request and issues.

About

llb2dot package lets you to convert BuildKit LLB to dot language to analize. You can also directly load Dockerfile

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published