remove method

Future<void> remove({
  1. bool force = true,
  2. bool noPrune = false,
})

Removes the image from the local Docker image cache.

Has no effect if cleanUp is false or if build was never called.

Parameters:

  • force — forces removal even if the image is referenced by stopped containers. Defaults to true.
  • noPrune — when true, parent images are not removed. Defaults to false.

Implementation

Future<void> remove({bool force = true, bool noPrune = false}) async {
  final imageId = _imageId;
  if (imageId != null && cleanUp) {
    await _dockerClient.removeImage(
      imageId,
      force: force,
      noPrune: noPrune,
    );
  }
}