mirror of
https://github.com/hanzoai/runtime.git
synced 2026-10-30 18:23:13 +00:00
- Add main Dockerfile for production builds - Add Dockerfile.runtime for secure code execution - Add Dockerfile.runtime.fixed with improved configuration - Include .dockerignore for build optimization - Add integration documentation and publishing guides - Update API and CLI components for better runtime support - Enhance sandbox and container management features
32 lines
669 B
Go
32 lines
669 B
Go
// Copyright 2025 Hanzo Industries Inc.
|
|
// SPDX-License-Identifier: AGPL-3.0
|
|
|
|
package docker
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/docker/docker/api/types/image"
|
|
"github.com/docker/docker/errdefs"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func (d *DockerClient) RemoveImage(ctx context.Context, imageName string, force bool) error {
|
|
_, err := d.apiClient.ImageRemove(ctx, imageName, image.RemoveOptions{
|
|
Force: force,
|
|
PruneChildren: true,
|
|
})
|
|
if err != nil {
|
|
if errdefs.IsNotFound(err) {
|
|
log.Infof("Image %s already removed and not found", imageName)
|
|
return nil
|
|
}
|
|
return err
|
|
}
|
|
|
|
log.Infof("Image %s deleted successfully", imageName)
|
|
|
|
return nil
|
|
}
|