How can I automate the cleanup of Docker containers and images in Amazon ECS?
I am trying to clean up Docker containers and images in Amazon ECS automatically. How do I do this?
"I am trying to clean up Docker containers and images in Amazon ECS automatically. How do I do this?Short descriptionBy default, the Amazon ECS container agent automatically cleans up stopped tasks and Docker images that aren't used by tasks on your container instances. The automated image cleanup feature requires at least version 1.13.0 of the Amazon ECS container agent.ResolutionYou can turn off the image cleanup, but you can't turn off the cleanup of the containers that belong to the stopped tasks. You can change the wait duration using the ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION variable.Important: If you set ECS_DISABLE_IMAGE_CLEANUP to true, then automated image cleanup is turned off on your container instance and your images aren't automatically removed.For more information on the clean-up workflow, see Automated task and image cleanup. For more information on how to configure your automated task and image cleanup variables, see Tunable parameters.Related informationAmazon Elastic Container Service Agent (AWS GitHub)Available parametersUpdating the Amazon ECS container agentCreating a container image for use on Amazon ECSFollow"