2017-02-11 00:48:15 +08:00
|
|
|
package buildah
|
|
|
|
|
|
|
|
import (
|
2017-06-02 03:23:02 +08:00
|
|
|
"github.com/pkg/errors"
|
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 {
|
2018-10-03 22:05:46 +08:00
|
|
|
return errors.Wrapf(err, "error deleting build container %q", b.ContainerID)
|
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
|
|
|
}
|