Skip to content

Latest commit

 

History

History
136 lines (99 loc) · 2.89 KB

docker.image.remove.rst

File metadata and controls

136 lines (99 loc) · 2.89 KB

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.

1.18.0

Args

ecr_repo

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 or image.

If using a private registry, only repo_name is required. If using a public registry, repo_name and registry_alias.

account_id

AWS account ID that owns the registry being logged into. If not provided, it will be acquired automatically if needed.

aws_region

AWS region where the registry is located. If not provided, it will be acquired automatically if needed.

registry_alias

If it is a public repository, provide the alias.

repo_name

The name of the repository.

force

Whether to force the removal of the image.

image

A ~runway.cfngin.hooks.docker.data_models.DockerImage object. This can be retrieved from hook_data for a preceding docker.image.build hook using the hook_data Lookup <hook_data lookup>.

If providing a value for this field, do not provide a value for ecr_repo or repo.

noprune

Whether to delete untagged parents.

repo

URI of a non Docker Hub repository where the image will be stored. If providing one of the other repo values or image, leave this value empty.

tags

List of tags to remove.

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