summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/delete.go
blob: 8de774ff993445be26a128c49b0ba4e6da2e6109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package buildah

import (
	"github.com/opencontainers/selinux/go-selinux/label"
	"github.com/pkg/errors"
)

// Delete removes the working container.  The buildah.Builder object should not
// be used after this method is called.
func (b *Builder) Delete() error {
	if err := b.store.DeleteContainer(b.ContainerID); err != nil {
		return errors.Wrapf(err, "error deleting build container")
	}
	b.MountPoint = ""
	b.Container = ""
	b.ContainerID = ""
	return label.ReleaseLabel(b.ProcessLabel)
}