docker.image.remove¶
- Hook Path:
runway.cfngin.hooks.docker.image.remove
Docker image remove hook.
Replicates the functionality of the docker image remove
CLI command.
Added in version 1.18.0.
Args¶
- ecr_repo: dict[str, str | None] | None = None
Information describing an ECR repository. This is used to construct the repository URL. If providing a value for this field, do not provide a value for
repo
orimage
.If using a private registry, only
repo_name
is required. If using a public registry,repo_name
andregistry_alias
.- account_id: str | None = None
AWS account ID that owns the registry being logged into. If not provided, it will be acquired automatically if needed.
- aws_region: str | None = None
AWS region where the registry is located. If not provided, it will be acquired automatically if needed.
- repo_name: str
The name of the repository.
- force: bool = False
Whether to force the removal of the image.
- image: DockerImage | None = None
A
DockerImage
object. This can be retrieved fromhook_data
for a preceding docker.image.build using the hook_data Lookup.If providing a value for this field, do not provide a value for
ecr_repo
orrepo
.
- noprune: bool = False
Whether to delete untagged parents.
Example¶
pre_deploy:
- path: runway.cfngin.hooks.docker.login
args:
ecr: true
password: ${ecr login-password}
- path: runway.cfngin.hooks.docker.image.build
args:
ecr_repo:
repo_name: ${cfn ${namespace}-test-ecr.Repository}
tags:
- latest
- python3.9
- path: runway.cfngin.hooks.docker.image.push
args:
image: ${hook_data docker.image}
tags:
- latest
- python3.9
stacks:
...
post_deploy:
- path: runway.cfngin.hooks.docker.image.remove
args:
image: ${hook_data docker.image}
tags:
- latest
- python3.9