Skip to content
v2.277.0

DockerCacheOption Struct ​

Options for configuring the Docker cache backend.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const dockerCacheOption: cdk.DockerCacheOption = {
  type: 'type',

  // the properties below are optional
  params: {
    paramsKey: 'params',
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

docker_cache_option = cdk.DockerCacheOption(
    type="type",

    # the properties below are optional
    params={
        "params_key": "params"
    }
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

DockerCacheOption dockerCacheOption = DockerCacheOption.builder()
        .type("type")

        // the properties below are optional
        .params(Map.of(
                "paramsKey", "params"))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var dockerCacheOption = new DockerCacheOption {
    Type = "type",

    // the properties below are optional
    Params = new Dictionary<string, string> {
        { "paramsKey", "params" }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

dockerCacheOption := &DockerCacheOption{
	Type: jsii.String("type"),

	// the properties below are optional
	Params: map[string]*string{
		"paramsKey": jsii.String("params"),
	},
}

Properties ​

paramsoptional{ [key: string]: string }paramsoptionaltyping.Mapping[str, str]paramsoptionalMap<String, String>ParamsoptionalIDictionary<string, string>Paramsoptional*map[string]*string #
Any parameters to pass into the docker cache backend configuration.

Default: {} No options provided

Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.

example
ts
declare const branch: string;

const params = {
  ref: `12345678.dkr.ecr.us-west-2.amazonaws.com/cache:${branch}`,
  mode: "max",
};
typestringtypestrtypeStringTypestringType*string = unspecified required #
The type of cache to use.

Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.

example
ts
'registry'