# DockerImageCode

Code property for the DockerImageFunction construct.

- Source: [`aws-lambda/lib/image-function.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-lambda/lib/image-function.ts#L29)

## Example

```ts
new lambda.DockerImageFunction(this, 'AssetFunction', {
  code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, 'docker-arm64-handler')),
  architecture: lambda.Architecture.ARM_64,
});
```

## Initializer

```ts
new DockerImageCode()
```

## Methods

- `fromEcr(repository: IRepository, props?: EcrImageCodeProps): DockerImageCode // chainable` (static) — Use an existing ECR image as the Lambda code.

  **Parameters**

  - `repository` — the ECR repository that the image is in.
  - `props` — properties to further configure the selected image.

- `fromImageAsset(directory: string, props?: AssetImageCodeProps): DockerImageCode // chainable` (static) — Create an ECR image from the specified asset and bind it as the Lambda code.

  **Parameters**

  - `directory` — the directory from which the asset must be created.
  - `props` — properties to further configure the selected image.
