configfile
On this page
Description
The command line client supports configuring by a given configuration file.
If existent, by default, the file $HOME/.ocmconfig will be read.
Using the option –config an alternative file can be specified.
The file format is yaml. It uses the same type mechanism used for all
kinds of typed specification in the ocm area. The file must have the type of
a configuration specification. Instead, the command line client supports
a generic configuration specification able to host a list of arbitrary configuration
specifications. The type for this spec is generic.config.ocm.software/v1.
The following configuration types are supported:
attributes.config.ocm.softwareThe config typeattributes.config.ocm.softwarecan be used to define a list of arbitrary attribute specifications:type: attributes.config.ocm.software attributes: <name>: <yaml defining the attribute> ...blobLimits.ocireg.ocm.config.ocm.softwareThe config typeblobLimits.ocireg.ocm.config.ocm.softwarecan be used to set some blob layer limits for particular OCI registries used to host OCM repositories. TheblobLimitsfield maps a OCI registry address to the blob limit to use:type: blobLimits.ocireg.ocm.config.ocm.software blobLimits: dummy.io: 65564 dummy.io:8443: 32768 // with :8443 specifying the port and 32768 specifying the byte limitIf blob limits apply to a registry, local blobs with a size larger than the configured limit will be split into several layers with a maximum size of the given value.
These settings can be overwritten by explicit settings in an OCM repository specification for those repositories.
The most specific entry will be used. If a registry with a dedicated port is requested, but no explicit configuration is found, the setting for the sole hostname is used (if configured).
cli.ocm.config.ocm.softwareThe config typecli.ocm.config.ocm.softwareis used to handle the main configuration flags of the OCM command line tool.type: cli.ocm.config.ocm.software aliases: <name>: <OCI registry specification> ...credentials.config.ocm.softwareThe config typecredentials.config.ocm.softwarecan be used to define a list of arbitrary configuration specifications:type: credentials.config.ocm.software consumers: - identity: <name>: <value> ... credentials: - <credential specification> ... credential chain repositories: - repository: <repository specification> credentials: - <credential specification> ... credential chain aliases: <name>: repository: <repository specification> credentials: - <credential specification> ... credential chaindownloader.ocm.config.ocm.softwareThe config typedownloader.ocm.config.ocm.softwarecan be used to define a list of preconfigured download handler registrations (see ocm ocm-downloadhandlers), the default priority is 200:type: downloader.ocm.config.ocm.software description: "my standard download handler configuration" registrations: - name: oci/artifact artifactType: ociImage mimeType: ... description: ... priority: ... config: ... ...generic.config.ocm.softwareThe config typegeneric.config.ocm.softwarecan be used to define a list of arbitrary configuration specifications and named configuration sets:type: generic.config.ocm.software configurations: - type: <any config type> ... ... sets: standard: description: my selectable standard config configurations: - type: ... ... ...Configurations are directly applied. Configuration sets are just stored in the configuration context and can be applied on-demand. On the CLI, this can be done using the main command option
–config-set <name>.hasher.config.ocm.softwareThe config typehasher.config.ocm.softwarecan be used to define the default hash algorithm used to calculate digests for resources. It supports the fieldhashAlgorithm, with one of the following values:NO-DIGESTSHA-256(default)SHA-512
keys.config.ocm.softwareThe config typekeys.config.ocm.softwarecan be used to define public and private keys. A key value might be given by one of the fields:path: path of file with key datadata: base64 encoded binary datastringdata: data a string parsed by key handler
type: keys.config.ocm.software privateKeys: <name>: path: <file path> ... publicKeys: <name>: data: <base64 encoded key representation> ... rootCertificates: - path: <file path> issuers: <name>: commonName: acme.orgIssuers define an expected distinguished name for public key certificates optionally provided together with signatures. They support the following fields:
commonNamestringorganizationstring arrayorganizationalUnitstring arraycountrystring arraylocalitystring arrayprovincestring arraystreetAddressstring arraypostalCodestring array
At least the given values must be present in the certificate to be accepted for a successful signature validation.
logging.config.ocm.softwareThe config typelogging.config.ocm.softwarecan be used to configure the logging aspect of a dedicated context type:type: logging.config.ocm.software contextType: attributes.context.ocm.software settings: defaultLevel: Info rules: - ...The context type attributes.context.ocm.software is the root context of a context hierarchy.
If no context type is specified, the config will be applies to any target acting as logging context provider, which is not a non-root context.
memory.credentials.config.ocm.softwareThe config typememory.credentials.config.ocm.softwarecan be used to define a list of arbitrary credentials stored in a memory based credentials repository:type: memory.credentials.config.ocm.software repoName: default credentials: - credentialsName: ref reference: # refer to a credential set stored in some other credential repository type: Credentials # this is a repo providing just one explicit credential set properties: username:password: - credentialsName: direct credentials: # direct credential specification username: password: merge.config.ocm.softwareThe config typemerge.config.ocm.softwarecan be used to set some assignments for the merging of (label) values. It applies to a value merge handler registry, either directly or via an OCM context.type: merge.config.ocm.software labels: - name: acme.org/audit/level merge: algorithm: acme.org/audit config: ... assignments: label:acme.org/audit/level@v1: algorithm: acme.org/audit config: ... ...oci.config.ocm.softwareThe config typeoci.config.ocm.softwarecan be used to define OCI registry aliases:type: oci.config.ocm.software aliases: <name>: <OCI registry specification> ...oci.uploader.config.ocm.softwareWARNING: This is an experimental feature. Will be replaced with native local blob support in OCM in the future.The config type
oci.uploader.config.ocm.softwarecan be used to set some configurations for the implicit OCI artifact upload for OCI based OCM repositories.type: oci.uploader.config.ocm.software preferRelativeAccess: true # use relative access methods for given target repositories. repositories: - localhost:5000If
preferRelativeAccessis set totruethe OCI uploader for OCI based OCM repositories does not use the OCI repository to create absolute OCI access methods if the target repository is in therepositorieslist. Instead, a relativerelativeOciReferenceaccess method is created. If this list is empty, all uploads are handled this way.If the global attribute
preferrelativeaccessis configured, it overrides thepreferRelativeAccesssetting.ocm.cmd.config.ocm.softwareThe config typeocm.cmd.config.ocm.softwarecan be used to configure predefined aliases for dedicated OCM repositories and OCI registries.type: ocm.cmd.config.ocm.software ocmRepositories: <name>: <specification of OCM repository> ... ociRepositories: <name>: <specification of OCI registry> ...ocm.config.ocm.softwareThe config typeocm.config.ocm.softwarecan be used to set some configurations for an OCM context;type: ocm.config.ocm.software aliases: myrepo: type: <any repository type> <specification attributes> ... resolvers: - repository: type: <any repository type> <specification attributes> ... prefix: ghcr.io/open-component-model/ocm priority: 10With aliases repository alias names can be mapped to a repository specification. The alias name can be used in a string notation for an OCM repository.
Resolvers define a list of OCM repository specifications to be used to resolve dedicated component versions. These settings are used to compose a standard component version resolver provided for an OCM context. Optionally, a component name prefix can be given. It limits the usage of the repository to resolve only components with the given name prefix (always complete name segments). An optional priority can be used to influence the lookup order. Larger value means higher priority (default 10).
All matching entries are tried to lookup a component version in the following order:
- highest priority first
- longest matching sequence of component name segments first.
If resolvers are defined, it is possible to use component version names on the command line without a repository. The names are resolved with the specified resolution rule. They are also used as default lookup repositories to lookup component references for recursive operations on component versions (
–lookupoption).plugin.config.ocm.softwareThe config typeplugin.config.ocm.softwarecan be used to configure a plugin.type: plugin.config.ocm.software plugin: <plugin name> config: <arbitrary configuration structure> disableAutoRegistration: <boolean flag to disable auto registration for up- and download handlers>rootcerts.config.ocm.softwareThe config typerootcerts.config.ocm.softwarecan be used to define general root certificates. A certificate value might be given by one of the fields:path: path of file with key datadata: base64 encoded binary datastringdata: data a string parsed by key handler
rootCertificates: - path: <file path>scripts.ocm.config.ocm.softwareThe config typescripts.ocm.config.ocm.softwarecan be used to define transfer scripts:type: scripts.ocm.config.ocm.software scripts: <name>: path: <>file path> <other name>: script: <>nested script as yaml>transport.ocm.config.ocm.softwareThe config typetransport.ocm.config.ocm.softwarecan be used to define transfer scripts:type: transport.ocm.config.ocm.software recursive: true overwrite: true localResourcesByValue: false resourcesByValue: true sourcesByValue: false keepGlobalAccess: false stopOnExistingVersion: false omitAccessTypes: - s3uploader.ocm.config.ocm.softwareThe config typeuploader.ocm.config.ocm.softwarecan be used to define a list of preconfigured upload handler registrations (see ocm ocm-uploadhandlers), the default priority is 200:type: uploader.ocm.config.ocm.software description: "my standard upload handler configuration" registrations: - name: oci/artifact artifactType: ociImage config: ociRef: ghcr.io/open-component-model/... ...
Examples
type: generic.config.ocm.software/v1
configurations:
- type: credentials.config.ocm.software
repositories:
- repository:
type: DockerConfig/v1
dockerConfigFile: "~/.docker/config.json"
propagateConsumerIdentity: true
- type: attributes.config.ocm.software
attributes: # map of attribute settings
compat: true
# - type: scripts.ocm.config.ocm.software
# scripts:
# "default":
# script:
# process: true