Regc.Mutate.Config (regc v0.0.2)
View SourceImmutable OCI/Docker image-config transformations.
Labels, volumes, exposed ports, and timestamps are changed in the config
document only. Regc.Mutate.finalize/2 computes the new config blob
descriptor and propagates it into the image manifest.
Summary
Functions
Adds an exposed-port key such as "8080" or "8080/tcp".
Adds a volume path to the runtime config.
Removes a config label.
Normalizes existing config and history timestamps.
Reads an RFC 3339 timestamp from a config label and normalizes timestamps.
Sets a config label. A nil value removes the label.
Removes an exposed-port key.
Removes a volume path from the runtime config.
Functions
@spec add_exposed_port(Regc.Mutate.Image.t(), String.t()) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Adds an exposed-port key such as "8080" or "8080/tcp".
@spec add_volume(Regc.Mutate.Image.t(), String.t()) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Adds a volume path to the runtime config.
@spec delete_label(Regc.Mutate.Image.t(), String.t()) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Removes a config label.
@spec normalize_timestamps( Regc.Mutate.Image.t(), DateTime.t() | String.t(), keyword() ) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Normalizes existing config and history timestamps.
Options:
:mode-:setreplaces every selected timestamp;:maxonly caps timestamps after the supplied value (default:max).:base_layers- leaves history belonging to this many leading non-empty base layers unchanged. The top-level configcreatedfield is still normalized (default0).
The timestamp may be a DateTime or an RFC 3339 string and is emitted in
canonical UTC form when a field changes.
@spec normalize_timestamps_from_label(Regc.Mutate.Image.t(), String.t(), keyword()) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Reads an RFC 3339 timestamp from a config label and normalizes timestamps.
@spec put_label(Regc.Mutate.Image.t(), String.t(), String.t() | nil) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Sets a config label. A nil value removes the label.
@spec remove_exposed_port(Regc.Mutate.Image.t(), String.t()) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Removes an exposed-port key.
@spec remove_volume(Regc.Mutate.Image.t(), String.t()) :: {:ok, Regc.Mutate.Image.t()} | {:error, Regc.Error.t()}
Removes a volume path from the runtime config.