mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 09:46:53 +01:00
149 lines
2.6 KiB
Plaintext
149 lines
2.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * cli_reference/opm-cli.adoc
|
|
|
|
ifdef::openshift-origin[]
|
|
:registry-image: quay.io/openshift/origin-operator-registry:4.6.0
|
|
endif::[]
|
|
ifndef::openshift-origin[]
|
|
:registry-image: registry.redhat.io/openshift4/ose-operator-registry:v4.6
|
|
endif::[]
|
|
|
|
[id="olm-installing-opm_{context}"]
|
|
= Installing `opm`
|
|
|
|
You can install the `opm` CLI tool on your Linux, macOS, or Windows workstation.
|
|
|
|
.Prerequisites
|
|
|
|
* For Linux, you must provide the following packages:
|
|
** `podman` version 1.9.3+ (version 2.0+ recommended)
|
|
** `glibc` version 2.28+
|
|
|
|
.Procedure
|
|
|
|
ifndef::openshift-origin[]
|
|
. Set the `REG_CREDS` environment variable to the file path of your registry
|
|
credentials for use in later steps. For example, for the `podman` CLI on Linux:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
|
|
----
|
|
|
|
. Authenticate with `registry.redhat.io`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ podman login registry.redhat.io
|
|
----
|
|
endif::[]
|
|
|
|
. Extract the `opm` binary for the operating system you want from the Operator
|
|
Registry image and copy it to your local file system.
|
|
+
|
|
--
|
|
* For Linux:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ oc image extract {registry-image} \
|
|
ifndef::openshift-origin[]
|
|
-a ${REG_CREDS} \
|
|
endif::[]
|
|
--path /usr/bin/opm:. \
|
|
--confirm
|
|
----
|
|
|
|
* For macOS:
|
|
|
|
.. Extract the binary:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ oc image extract {registry-image} \
|
|
ifndef::openshift-origin[]
|
|
-a ${REG_CREDS} \
|
|
endif::[]
|
|
--path /usr/bin/darwin-amd64-opm:. \
|
|
--confirm
|
|
----
|
|
|
|
.. Rename the file to `opm`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ mv darwin-amd64-opm opm
|
|
----
|
|
|
|
* For Windows:
|
|
|
|
.. Extract the binary:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
C:\> oc image extract {registry-image} \
|
|
ifndef::openshift-origin[]
|
|
-a ${REG_CREDS} \
|
|
endif::[]
|
|
--path /usr/bin/windows-amd64-opm:. \
|
|
--confirm
|
|
----
|
|
|
|
.. Rename the file to `opm.exe`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
C:\> rename windows-amd64-opm opm.exe
|
|
----
|
|
--
|
|
|
|
. For Linux or macOS, make the binary executable:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ chmod +x ./opm
|
|
----
|
|
|
|
. Place the file anywhere in your `PATH`. For example:
|
|
+
|
|
--
|
|
* For Linux or macOS:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo mv ./opm /usr/local/bin/
|
|
----
|
|
|
|
* For Windows:
|
|
|
|
.. Check your `PATH`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
C:\> path
|
|
----
|
|
|
|
.. Move the file:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
C:\> move opm.exe <directory>
|
|
----
|
|
--
|
|
|
|
. Verify that the client was installed correctly:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ opm version
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
Version: version.Version{OpmVersion:"1.12.3", GitCommit:"", BuildDate:"2020-07-01T23:18:58Z", GoOs:"linux", GoArch:"amd64"}
|
|
----
|
|
|
|
:!registry-image:
|