diff --git a/builder/builder.go b/builder/builder.go index 76c66484635b038275c0dd127d9ef678f2cafc9f..ab3d2a9f25545570a11b82dd6f0ae43a8eab8c5b 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 6eb8f9b1d4ad8ecc9ff60f7b92f27a8ada23a4a0..8986c1277a95a2ea913f9dd82fec5305cea93570 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 1278ffcf91be5d3924741290bf0fd9fecd915128..41c2e045e0e9f6267a6bd6d91a42273e3c951638 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 }