libera_utils.aws.ecr_upload.build_docker_image#
- libera_utils.aws.ecr_upload.build_docker_image(context_dir: str | Path, image_name: str, tag: str = 'latest', target: str | None = None, platform: str = 'linux/amd64') None #
Build a Docker image from a specified directory and tag it with a custom name.
- Parameters:
context_dir (Union[str, Path]) – The path to the directory containing the Dockerfile and other build context.
image_name (str) – The name to give the Docker image.
tag (str, optional) – The tag to apply to the image (default is ‘latest’).
target (Optional[str]) – Name of the target to build.
platform (str) – Default “linux/amd64”.
- Raises:
ValueError – If the specified directory does not exist or the build fails.