Installing the OCM CLI
Overview
You can install the latest release of the OCM CLI from any of the following sources (more details below):
Bash
To install with bash for macOS or Linux, execute the following command:
curl -s https://ocm.software/install.sh | sudo bashInstall using Homebrew
# Homebrew (macOS and Linux)
brew install open-component-model/tap/ocmInstall using Nix (with Flakes)
# Nix (macOS, Linux, and Windows)
# ad hoc cmd execution
nix run github:open-component-model/ocm -- --help
nix run github:open-component-model/ocm#helminstaller -- --help
# install development version
nix profile install github:open-component-model/ocm
# or release <version>
nix profile install github:open-component-model/ocm/<version>
#check installation
nix profile list | grep ocm
# optionally, open a new shell and verify that cmd completion works
ocm --helpsee: Flakes
Install from AUR (Arch Linux User Repository)
# if not using a helper util
git clone https://aur.archlinux.org/ocm-cli.git
cd ocm-cli
makepkg -iInstall using Docker / Podman
podman run -t ghcr.io/open-component-model/ocm:latest --helpBuild and Run It Yourself
podman build -t ocm .
podman run --rm -t ocm --loglevel debug --helpor interactively:
podman run --rm -it ocm /bin/shYou can pass in the following arguments to override the predefined defaults:
GO_VERSION: The golang version to be used for compiling.ALPINE_VERSION: The alpine version to be used as the base image.GO_PROXY: Your go proxy to be used for fetching dependencies.
Please check hub.docker.com for possible version combinations.
podman build -t ocm --build-arg GO_VERSION=1.22 --build-arg ALPINE_VERSION=3.19 --build-arg GO_PROXY=https://proxy.golang.org .on MS Windows
using Chocolatey
choco install ocm-clisee: chocolatey community package: ocm-cli
using winget
Deprecated: Please note, winget packages are no longer provided. Any existing packages are still working, but no new packages are built and published to winget repository.
Building from Source
Prerequisites
Installation Process
Clone the open-component-model/ocm repo:
git clone https://github.com/open-component-model/ocmEnter the repository directory (cd ocm/) and install the cli using make:
make installPlease note that the OCM CLI is installed in your
go/bindirectory, so you might need to add this directory to yourPATH.
Verify the installation:
ocm version