# DockerCacheOption

Options for configuring the Docker cache backend.

- Source: [`core/lib/assets.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/core/lib/assets.ts#L438)
- Type last changed: v2.69.0 · 14 Mar 2023

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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" }
    }
};
```

Golang:

```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

- `params`: { [key: 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.

  ```ts
  declare const branch: string;

  const params = {
    ref: `12345678.dkr.ecr.us-west-2.amazonaws.com/cache:${branch}`,
    mode: "max",
  };
  ```

- `type`: string (required) = unspecified — The type of cache to use.

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

  ```ts
  'registry'
  ```
