> **Experimental**
>
> `@aws-cdk/aws-imagebuilder-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# DockerfileData

Helper class for referencing and uploading dockerfile data for the container recipe.

Extends: DockerfileData
Superclass of: S3DockerfileData

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/container-recipe.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-imagebuilder-alpha/lib/container-recipe.ts#L191)

## Example

```ts
const containerRecipe = new imagebuilder.ContainerRecipe(this, 'CustomDockerfileContainerRecipe', {
  baseImage: imagebuilder.BaseContainerImage.fromDockerHub('amazonlinux', 'latest'),
  targetRepository: imagebuilder.Repository.fromEcr(
    ecr.Repository.fromRepositoryName(this, 'Repository', 'my-container-repo')
  ),
  dockerfile: imagebuilder.DockerfileData.fromInline(`
FROM {{{ imagebuilder:parentImage }}}
CMD ["echo", "Hello, world!"]
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
`)
});
```

## Initializer

```ts
new DockerfileData()
```

## Methods

- `fromAsset(scope: Construct, id: string, path: string, options?: AssetOptions): S3DockerfileData` (static) — Uploads dockerfile data from a local file to S3 to use as the dockerfile data.

  **Parameters**

  - `scope` — The construct scope.
  - `id` — Identifier of the construct.
  - `path` — The local path to the dockerfile data file.
  - `options` — S3 asset upload options.

- `fromInline(data: string): DockerfileData // chainable` (static) — Uses an inline string as the dockerfile data.

  **Parameters**

  - `data` — An inline string representing the dockerfile data.

- `fromS3(bucket: IBucket, key: string): S3DockerfileData` (static) — References dockerfile data from a pre-existing S3 object.

  **Parameters**

  - `bucket` — The S3 bucket where the dockerfile data is stored.
  - `key` — The S3 key of the dockerfile data file.

- `render(): DockerfileTemplateConfig` — The rendered Dockerfile value, for use in CloudFormation.

  - For inline dockerfiles, dockerfileTemplateData is the Dockerfile template text
  - For S3-backed dockerfiles, dockerfileTemplateUri is the S3 URL
