pub struct ImageConfiguration { /* private fields */ }
Expand description

The image configuration is associated with an image and describes some basic information about the image such as date created, author, as well as execution/runtime configuration like its entrypoint, default arguments, networking, and volumes.

Implementations

An combined date and time at which the image was created, formatted as defined by RFC 3339, section 5.6.

Gives the name and/or email address of the person or entity which created and is responsible for maintaining the image.

The CPU architecture which the binaries in this image are built to run on. Configurations SHOULD use, and implementations SHOULD understand, values listed in the Go Language document for GOARCH.

The name of the operating system which the image is built to run on. Configurations SHOULD use, and implementations SHOULD understand, values listed in the Go Language document for GOOS.

This OPTIONAL property specifies the version of the operating system targeted by the referenced blob. Implementations MAY refuse to use manifests where os.version is not known to work with the host OS version. Valid values are implementation-defined. e.g. 10.0.14393.1066 on windows.

This OPTIONAL property specifies an array of strings, each specifying a mandatory OS feature. When os is windows, image indexes SHOULD use, and implementations SHOULD understand the following values:

  • win32k: image requires win32k.sys on the host (Note: win32k.sys is missing on Nano Server)

The variant of the specified CPU architecture. Configurations SHOULD use, and implementations SHOULD understand, variant values listed in the Platform Variants table.

The execution parameters which SHOULD be used as a base when running a container using the image. This field can be None, in which case any execution parameters should be specified at creation of the container.

The rootfs key references the layer content addresses used by the image. This makes the image config hash depend on the filesystem hash.

Describes the history of each layer. The array is ordered from first to last.

The rootfs key references the layer content addresses used by the image. This makes the image config hash depend on the filesystem hash.

Describes the history of each layer. The array is ordered from first to last.

An combined date and time at which the image was created, formatted as defined by RFC 3339, section 5.6.

Gives the name and/or email address of the person or entity which created and is responsible for maintaining the image.

The CPU architecture which the binaries in this image are built to run on. Configurations SHOULD use, and implementations SHOULD understand, values listed in the Go Language document for GOARCH.

The name of the operating system which the image is built to run on. Configurations SHOULD use, and implementations SHOULD understand, values listed in the Go Language document for GOOS.

This OPTIONAL property specifies the version of the operating system targeted by the referenced blob. Implementations MAY refuse to use manifests where os.version is not known to work with the host OS version. Valid values are implementation-defined. e.g. 10.0.14393.1066 on windows.

This OPTIONAL property specifies an array of strings, each specifying a mandatory OS feature. When os is windows, image indexes SHOULD use, and implementations SHOULD understand the following values:

  • win32k: image requires win32k.sys on the host (Note: win32k.sys is missing on Nano Server)

The variant of the specified CPU architecture. Configurations SHOULD use, and implementations SHOULD understand, variant values listed in the Platform Variants table.

The execution parameters which SHOULD be used as a base when running a container using the image. This field can be None, in which case any execution parameters should be specified at creation of the container.

The rootfs key references the layer content addresses used by the image. This makes the image config hash depend on the filesystem hash.

Describes the history of each layer. The array is ordered from first to last.

Attempts to load an image configuration from a file.

Errors

This function will return an OciSpecError::Io if the file does not exist or an OciSpecError::SerDe if the image configuration cannot be deserialized.

Example
use oci_spec::image::ImageConfiguration;

let image_index = ImageConfiguration::from_file("config.json").unwrap();

Attempts to load an image configuration from a stream.

Errors

This function will return an OciSpecError::SerDe if the image configuration cannot be deserialized.

Example
use oci_spec::image::ImageConfiguration;
use std::fs::File;

let reader = File::open("config.json").unwrap();
let image_index = ImageConfiguration::from_reader(reader).unwrap();

Attempts to write an image configuration to a file as JSON. If the file already exists, it will be overwritten.

Errors

This function will return an OciSpecError::SerDe if the image configuration cannot be serialized.

Example
use oci_spec::image::ImageConfiguration;

let image_index = ImageConfiguration::from_file("config.json").unwrap();
image_index.to_file("my-config.json").unwrap();

Attempts to write an image configuration to a file as pretty printed JSON. If the file already exists, it will be overwritten.

Errors

This function will return an OciSpecError::SerDe if the image configuration cannot be serialized.

Example
use oci_spec::image::ImageConfiguration;

let image_index = ImageConfiguration::from_file("config.json").unwrap();
image_index.to_file_pretty("my-config.json").unwrap();

Attempts to write an image configuration to a stream as JSON.

Errors

This function will return an OciSpecError::SerDe if the image configuration cannot be serialized.

Example
use oci_spec::image::ImageConfiguration;

let image_index = ImageConfiguration::from_file("config.json").unwrap();
let mut writer = Vec::new();
image_index.to_writer(&mut writer);

Attempts to write an image configuration to a stream as pretty printed JSON.

Errors

This function will return an OciSpecError::SerDe if the image configuration cannot be serialized.

Example
use oci_spec::image::ImageConfiguration;

let image_index = ImageConfiguration::from_file("config.json").unwrap();
let mut writer = Vec::new();
image_index.to_writer_pretty(&mut writer);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.