@Override
    public void postHook(WorkflowContext context) throws HyscaleException {
        logger.debug("Cleaning up temp built image");
        ServiceSpec serviceSpec = context.getServiceSpec();
        if (serviceSpec == null) {
            logger.error(" Cannot clean up image without service specs ");
            throw new HyscaleException(ServiceSpecErrorCodes.SERVICE_SPEC_REQUIRED);
        }

        String serviceName = context.getServiceName() != null ? context.getServiceName()
                : serviceSpec.get(HyscaleSpecFields.name, String.class);

        String tag = serviceSpec.get(HyscaleSpecFields.getPath(HyscaleSpecFields.image, HyscaleSpecFields.tag),
                String.class);

        // Clean up temp image
        String imageName = imageMetadataProvider.getBuildImageNameWithTag(context.getAppName(), serviceName, tag);
        hyscaleDockerClient.deleteImage(imageName, false);
    }
Hook to clean up local images created during build time
workflow-controller/controller-service/src/main/java/io/hyscale/controller/hooks/ImageCleanUpHook.java