DockerBuildOptions

class aws_cdk.core.DockerBuildOptions(*, build_args=None, file=None, platform=None)

Bases: object

Docker build options.

Parameters
  • build_args (Optional[Mapping[str, str]]) – Build args. Default: - no build args

  • file (Optional[str]) – Name of the Dockerfile, must relative to the docker build path. Default: Dockerfile

  • platform (Optional[str]) – Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+. Example value: linux/amd64 Default: - no platform specified

ExampleMetadata

infused

Example:

lambda_.Function(self, "Function",
    code=lambda_.Code.from_asset("/path/to/handler",
        bundling=BundlingOptions(
            image=DockerImage.from_build("/path/to/dir/with/DockerFile",
                build_args={
                    "ARG1": "value1"
                }
            ),
            command=["my", "cool", "command"]
        )
    ),
    runtime=lambda_.Runtime.PYTHON_3_9,
    handler="index.handler"
)

Attributes

build_args

Build args.

Default
  • no build args

Return type

Optional[Mapping[str, str]]

file

Name of the Dockerfile, must relative to the docker build path.

Default

Dockerfile

Return type

Optional[str]

platform

Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.

Example value: linux/amd64

Default
  • no platform specified

Return type

Optional[str]