diff --git a/builder/builder.go b/builder/builder.go index 76c6648463..ab3d2a9f25 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -62,8 +62,6 @@ type ExecBackend interface { ContainerCreateIgnoreImagesArgsEscaped(ctx context.Context, config backend.ContainerCreateConfig) (container.CreateResponse, error) // ContainerRm removes a container specified by `id`. ContainerRm(name string, config *backend.ContainerRmConfig) error - // ContainerKill stops the container execution abruptly. - ContainerKill(containerID string, sig string) error // ContainerStart starts a new container ContainerStart(ctx context.Context, containerID string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error // ContainerWait stops processing until the given container is stopped. diff --git a/builder/dockerfile/containerbackend.go b/builder/dockerfile/containerbackend.go index 6eb8f9b1d4..8986c1277a 100644 --- a/builder/dockerfile/containerbackend.go +++ b/builder/dockerfile/containerbackend.go @@ -61,8 +61,7 @@ func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr i go func() { select { case <-ctx.Done(): - log.G(ctx).Debugln("Build cancelled, killing and removing container:", cID) - c.backend.ContainerKill(cID, "") + log.G(ctx).Debugln("Build cancelled, removing container:", cID) err = c.backend.ContainerRm(cID, &backend.ContainerRmConfig{ForceRemove: true, RemoveVolume: true}) if err != nil { _, _ = fmt.Fprintf(stdout, "Removing container %s: %v\n", stringid.TruncateID(cID), err) diff --git a/builder/dockerfile/mockbackend_test.go b/builder/dockerfile/mockbackend_test.go index 1278ffcf91..41c2e045e0 100644 --- a/builder/dockerfile/mockbackend_test.go +++ b/builder/dockerfile/mockbackend_test.go @@ -45,10 +45,6 @@ func (m *MockBackend) CommitBuildStep(ctx context.Context, c backend.CommitConfi return "", nil } -func (m *MockBackend) ContainerKill(containerID string, sig string) error { - return nil -} - func (m *MockBackend) ContainerStart(ctx context.Context, containerID string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error { return nil }