Interface IDockerCacheOption
Options for configuring the Docker cache backend.
Namespace: Amazon.CDK.AWS.Ecr.Assets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IDockerCacheOption
Syntax (vb)
Public Interface IDockerCacheOption
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Ecr.Assets;
var asset = new DockerImageAsset(this, "MyBuildImage", new DockerImageAssetProps {
Directory = Join(__dirname, "my-image"),
CacheFrom = new [] { new DockerCacheOption { Type = "registry", Params = new Dictionary<string, string> { { "ref", "ghcr.io/myorg/myimage:cache" } } } },
CacheTo = new DockerCacheOption { Type = "registry", Params = new Dictionary<string, string> { { "ref", "ghcr.io/myorg/myimage:cache" }, { "mode", "max" }, { "compression", "zstd" } } }
});
Synopsis
Properties
Params | Any parameters to pass into the docker cache backend configuration. |
Type | The type of cache to use. |
Properties
Params
Any parameters to pass into the docker cache backend configuration.
virtual IDictionary<string, string> Params { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.
Default: {} No options provided
Examples
string branch;
IDictionary<string, object> params = new Dictionary<string, object> {
{ "ref", $"12345678.dkr.ecr.us-west-2.amazonaws.com/cache:{branch}" },
{ "mode", "max" }
};
Type
The type of cache to use.
string Type { get; }
Property Value
System.String
Remarks
Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.
Default: - unspecified
Examples
"registry";