Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DFCmd = &cobra.Command{ Use: "dockerfile", Short: "dockerfile generates a dockerfile for the app", Aliases: []string{"df"}, Long: ` bsf dockerfile <environment name> bsf dockerfile <environment name> --platform <platform> bsf dockerfile <environment name> --platform <platform> --output <output filename> `, Run: func(cmd *cobra.Command, args []string) { if len(args) < 1 { fmt.Println(styles.HintStyle.Render("hint:", "run `bsf dockerfile <environment name>` to export the environment")) os.Exit(1) } env, p, err := ocicmd.ProcessPlatformAndConfig(platform, args[0]) if err != nil { fmt.Println(styles.ErrorStyle.Render("error: ", err.Error())) os.Exit(1) } platform = p sc, fh, err := binit.GetBSFInitializers() if err != nil { fmt.Println(styles.ErrorStyle.Render("error: ", err.Error())) os.Exit(1) } err = generate.Generate(fh, sc) if err != nil { fmt.Println(styles.ErrorStyle.Render("error: ", err.Error())) os.Exit(1) } err = bgit.Add("bsf/") if err != nil { fmt.Println(styles.ErrorStyle.Render("error: ", err.Error())) os.Exit(1) } var dfw io.Writer if output == "" { dfw = os.Stdout } else { dfh, err := os.Create(output) if err != nil { fmt.Println(styles.ErrorStyle.Render("error: ", err.Error())) os.Exit(1) } defer dfh.Close() dfw = dfh } err = builddocker.GenerateDockerfile(dfw, env, platform) if err != nil { fmt.Println(styles.ErrorStyle.Render("error: ", err.Error())) os.Exit(1) } }, }
DFCmd represents the generate command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.