You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#installing-mirroring-disconnected[Mirroring images for a disconnected installation using the oc-mirror plugin]
You can create a catalog image that uses the plain text _file-based catalog_ format (JSON or YAML), which replaces the deprecated SQLite database format. The `opm` CLI provides tooling that helps initialize a catalog in the file-based format, render new records into it, and validate that the catalog is valid.
16
+
You can use the `opm` CLI to create a catalog image that uses the plain text _file-based catalog_ format (JSON or YAML), which replaces the deprecated SQLite database format.
17
17
18
18
.Prerequisites
19
19
@@ -23,47 +23,45 @@ You can create a catalog image that uses the plain text _file-based catalog_ for
23
23
24
24
.Procedure
25
25
26
-
. Initialize a catalog for a file-based catalog:
26
+
. Initialize the catalog:
27
27
28
-
.. Create a directory for the catalog:
28
+
.. Create a directory for the catalog by running the following command:
29
29
+
30
30
[source,terminal]
31
31
----
32
-
$ mkdir <operator_name>-index
32
+
$ mkdir <catalog_dir>
33
33
----
34
34
35
-
.. Create a Dockerfile that can build a catalog image:
35
+
.. Generate a Dockerfile that can build a catalog image by running the `opm generate dockerfile` command:
36
36
+
37
-
.Example `<operator_name>-index.Dockerfile`
38
-
[source,bash,subs="attributes+"]
37
+
[source,terminal,subs="attributes+"]
39
38
----
40
-
# The base image is expected to contain
41
-
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
42
-
FROM {registry-image}
43
-
44
-
# Configure the entrypoint and command
45
-
ENTRYPOINT ["/bin/opm"]
46
-
CMD ["serve", "/configs"]
47
-
48
-
# Copy declarative config root into image at /configs
49
-
ADD <operator_name>-index /configs
50
-
51
-
# Set DC-specific label for the location of the DC root directory
The `opm render` command generates a declarative config blob from the provided catalog images and bundle images.
92
+
<1> Pull spec for the bundle image
93
+
<2> Path to the catalog configuration file
98
94
+
99
95
[NOTE]
100
96
====
101
97
Channels must contain at least one bundle.
102
98
====
103
99
104
-
. Add a channel entry for the bundle. For example, modify the following example to your specifications, and add it to your `<operator_name>-index/index.yaml` file:
100
+
. Add a channel entry for the bundle. For example, modify the following example to your specifications, and add it to your `<catalog_dir>/index.yaml` file:
105
101
+
106
102
.Example channel entry
107
103
[source,yaml]
@@ -113,15 +109,15 @@ name: preview
113
109
entries:
114
110
- name: <operator_name>.v0.1.0 <1>
115
111
----
116
-
<1> Ensure that you include the period (`.`) after `<operator_name>` but before the `v` in the version. Otherwise, the entry will fail to pass the `opm validate` command.
112
+
<1> Ensure that you include the period (`.`) after `<operator_name>` but before the `v` in the version. Otherwise, the entry fails to pass the `opm validate` command.
117
113
118
114
. Validate the file-based catalog:
119
115
120
116
.. Run the `opm validate` command against the catalog directory:
121
117
+
122
118
[source,terminal]
123
119
----
124
-
$ opm validate <operator_name>-index
120
+
$ opm validate <catalog_dir>
125
121
----
126
122
127
123
.. Check that the error code is `0`:
@@ -137,25 +133,25 @@ $ echo $?
137
133
0
138
134
----
139
135
140
-
. Build the catalog image:
136
+
. Build the catalog image by running the `podman build` command:
|Generate a Dockerfile for a declarative config index.
23
+
|===
24
+
25
+
.`generate` flags
26
+
[options="header",cols="1,3"]
27
+
|===
28
+
|Flags |Description
29
+
30
+
|`-h`, `--help`
31
+
|Help for generate.
39
32
40
33
|===
41
34
35
+
42
36
[id="opm-cli-ref-generate-dockerfile_{context}"]
43
37
== dockerfile
44
38
45
39
Generate a Dockerfile for a declarative config index.
46
40
47
41
[IMPORTANT]
48
42
====
49
-
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.
43
+
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.
50
44
51
45
When specifying extra labels, if duplicate keys exist, only the last value of each duplicate key gets added to the generated Dockerfile.
0 commit comments