# DockerBuildAssetOptions

Options when creating an asset from a Docker build.

Extends: DockerBuildAssetOptions
Extends: DockerBuildOptions

- Source: [`aws-lambda/lib/code.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-lambda/lib/code.ts#L831)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const dockerBuildAssetOptions: lambda.DockerBuildAssetOptions = {
  buildArgs: {
    buildArgsKey: 'buildArgs',
  },
  buildContexts: {
    buildContextsKey: 'buildContexts',
  },
  cacheDisabled: false,
  cacheFrom: [{
    type: 'type',

    // the properties below are optional
    params: {
      paramsKey: 'params',
    },
  }],
  cacheTo: {
    type: 'type',

    // the properties below are optional
    params: {
      paramsKey: 'params',
    },
  },
  file: 'file',
  imagePath: 'imagePath',
  network: 'network',
  outputPath: 'outputPath',
  platform: 'platform',
  targetStage: 'targetStage',
};
```

## Properties

- `buildArgs`: { [key: string]: string } — Build args.

  **Default:** no build args

- `buildContexts`: { [key: string]: string } — Build contexts to pass to the `docker build` command.

  **Default:** no additional build contexts

  Build contexts can be used to specify additional directories or images
  to use during the build. Each entry specifies a named build context
  and its source (a directory path, a URL, or a docker image).

- `cacheDisabled`: boolean — Disable the cache and pass `--no-cache` to the `docker build` command.

  **Default:** cache is used

- `cacheFrom`: [DockerCacheOption](/cdk/api/v2/docs/aws-cdk-lib.DockerCacheOption.html)[] — Cache from options to pass to the `docker build` command.

  **Default:** no cache from args are passed

- `cacheTo`: [DockerCacheOption](/cdk/api/v2/docs/aws-cdk-lib.DockerCacheOption.html) — Cache to options to pass to the `docker build` command.

  **Default:** no cache to args are passed

- `file`: string = `Dockerfile` — Name of the Dockerfile, must relative to the docker build path.

- `imagePath`: string = /asset — The path in the Docker image where the asset is located after the build operation.

- `network`: string — Docker [Networking options](https://docs.docker.com/reference/cli/docker/buildx/build/#network).

  **Default:** no networking options

- `outputPath`: string — The path on the local filesystem where the asset will be copied using `docker cp`.

  **Default:** a unique temporary directory in the system temp directory

- `platform`: string — Set platform if server is multi-platform capable. _Requires Docker Engine API v1.38+_.

  **Default:** no platform specified

  Example value: `linux/amd64`

- `targetStage`: string — Set build target for multi-stage container builds. Any stage defined afterwards will be ignored.

  **Default:** Build all stages defined in the Dockerfile

  Example value: `build-env`
