INNER CODE UNIT · Go
build
container2wasm/container2wasm · cmd/c2w/main.go:184
func build(builderPath string, srcImgPath string, destDir, destFile string, clicontext *cli.Context) error {
buildxArgs := []string{
"buildx", "build", "--progress=plain",
"--build-arg", fmt.Sprintf("TARGETARCH=%s", clicontext.String("target-arch")),
"--build-arg", fmt.Sprintf("TARGETPLATFORM=linux/%s", clicontext.String("target-arch")),
"--platform=linux/amd64",
}
var dockerfilePath string
if o := clicontext.String("dockerfile"); o != "" {
dockerfilePath = o
} else {
f, err := os.CreateTemp("", "container2wasm")
if err != nil {
return err
}
defer os.Remove(f.Name())
if _, err := f.Write(vendor.Dockerfile); err != nil {
return err