2023-04-21 16:07:05 -06:00
// Module included in the following assemblies:
2023-03-17 16:57:19 +05:30
//
2023-04-21 16:07:05 -06:00
// * cli_reference/opm/cli-opm-ref.adoc
2023-03-17 16:57:19 +05:30
[id="opm-cli-ref-generate_{Context}"]
= generate
Generate various artifacts for declarative config indexes.
.Command syntax
[source,terminal]
----
$ opm generate <subcommand> [<flags>]
----
.`generate` subcommands
[options="header",cols="1,3"]
|===
|Subcommand |Description
|`dockerfile`
|Generate a Dockerfile for a declarative config index.
2023-04-21 16:07:05 -06:00
|===
.`generate` flags
[options="header",cols="1,3"]
|===
|Flags |Description
|`-h`, `--help`
|Help for generate.
2023-03-17 16:57:19 +05:30
|===
2023-04-21 16:07:05 -06:00
2023-03-17 16:57:19 +05:30
[id="opm-cli-ref-generate-dockerfile_{context}"]
== dockerfile
Generate a Dockerfile for a declarative config index.
[IMPORTANT]
====
2023-04-21 16:07:05 -06:00
This command creates a Dockerfile in the same directory as the `<dcRootDir>` (named `<dcDirName>.Dockerfile`) that is used to build the index. If a Dockerfile with the same name already exists, this command fails.
2023-03-17 16:57:19 +05:30
When specifying extra labels, if duplicate keys exist, only the last value of each duplicate key gets added to the generated Dockerfile.
====
.Command syntax
[source,terminal]
----
2023-04-21 16:07:05 -06:00
$ opm generate dockerfile <dcRootDir> [<flags>]
2023-03-17 16:57:19 +05:30
----
.`generate dockerfile` flags
[options="header",cols="1,3"]
|===
|Flag |Description
|`-i,` `--binary-image` (string)
|Image in which to build catalog. The default value is `quay.io/operator-framework/opm:latest`.
|`-l`, `--extra-labels` (string)
|Extra labels to include in the generated Dockerfile. Labels have the form `key=value`.
|`-h`, `--help`
|Help for Dockerfile.
2023-04-21 16:07:05 -06:00
|===
ifndef::openshift-origin[]
[NOTE]
====
To build with the official Red Hat image, use the `registry.redhat.io/openshift4/ose-operator-registry:v{product-version}` value with the `-i` flag.
====
endif::[]