diff --git a/bib/cmd/bootc-image-builder/image.go b/bib/cmd/bootc-image-builder/image.go index f1ba66a9a..8bc590748 100644 --- a/bib/cmd/bootc-image-builder/image.go +++ b/bib/cmd/bootc-image-builder/image.go @@ -42,6 +42,9 @@ type ManifestConfig struct { // TLSVerify specifies whether HTTPS and a valid TLS certificate are required TLSVerify bool + + // Use a local container from the host rather than a repository + Local bool } func Manifest(c *ManifestConfig) (*manifest.Manifest, error) { @@ -65,6 +68,7 @@ func manifestForDiskImage(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest Source: c.Imgref, Name: c.Imgref, TLSVerify: &c.TLSVerify, + Local: c.Local, } var customizations *blueprint.Customizations @@ -139,6 +143,7 @@ func manifestForDiskImage(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest Source: c.Imgref, Name: c.Imgref, TLSVerify: &c.TLSVerify, + Local: c.Local, }, } _, err = img.InstantiateManifestFromContainers(&mf, containerSources, runner, rng) @@ -155,6 +160,7 @@ func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, erro Source: c.Imgref, Name: c.Imgref, TLSVerify: &c.TLSVerify, + Local: c.Local, } // The ref is not needed and will be removed from the ctor later diff --git a/bib/cmd/bootc-image-builder/main.go b/bib/cmd/bootc-image-builder/main.go index 6db227c1a..09208f86b 100644 --- a/bib/cmd/bootc-image-builder/main.go +++ b/bib/cmd/bootc-image-builder/main.go @@ -182,6 +182,7 @@ func manifestFromCobra(cmd *cobra.Command, args []string) ([]byte, error) { rpmCacheRoot, _ := cmd.Flags().GetString("rpmmd") configFile, _ := cmd.Flags().GetString("config") tlsVerify, _ := cmd.Flags().GetBool("tls-verify") + localStorage, _ := cmd.Flags().GetBool("local") imgType, _ := cmd.Flags().GetString("type") targetArch, _ := cmd.Flags().GetString("target-arch") if targetArch != "" { @@ -215,6 +216,7 @@ func manifestFromCobra(cmd *cobra.Command, args []string) ([]byte, error) { Repos: repos, Architecture: buildArch, TLSVerify: tlsVerify, + Local: localStorage, } return makeManifest(manifestConfig, rpmCacheRoot) } @@ -351,6 +353,7 @@ func run() error { manifestCmd.Flags().String("type", "qcow2", "image type to build [qcow2, ami]") manifestCmd.Flags().Bool("tls-verify", true, "require HTTPS and verify certificates when contacting registries") manifestCmd.Flags().String("target-arch", "", "build for the given target architecture (experimental)") + manifestCmd.Flags().Bool("local", false, "use a local container rather than a container from a registry") logrus.SetLevel(logrus.ErrorLevel) buildCmd.Flags().AddFlagSet(manifestCmd.Flags())