2017-02-11 00:48:15 +08:00
|
|
|
package buildah
|
|
|
|
|
2022-07-06 17:14:06 +08:00
|
|
|
import "fmt"
|
2017-02-11 00:48:15 +08:00
|
|
|
|
2017-03-25 01:48:39 +08:00
|
|
|
// Delete removes the working container. The buildah.Builder object should not
|
|
|
|
// be used after this method is called.
|
2017-02-11 00:48:15 +08:00
|
|
|
func (b *Builder) Delete() error {
|
|
|
|
if err := b.store.DeleteContainer(b.ContainerID); err != nil {
|
2022-09-18 18:36:08 +08:00
|
|
|
return fmt.Errorf("deleting build container %q: %w", b.ContainerID, err)
|
2017-02-11 00:48:15 +08:00
|
|
|
}
|
|
|
|
b.MountPoint = ""
|
|
|
|
b.Container = ""
|
|
|
|
b.ContainerID = ""
|
2018-10-20 02:49:51 +08:00
|
|
|
return nil
|
2017-02-11 00:48:15 +08:00
|
|
|
}
|