moby/builder/dockerfile
Sebastiaan van Stijn 1f9098e7d0
builder: remove redundant ExecBackend.ContainerKill()
The `ExecBackend.ContainerKill()` function was called before removing a build-
container.

This function is backed by `daemon.ContainerKill()` which, if no signal is passed,
performed a `daemon.Kill()`, using `SIGKILL` as signal. However, the
`ExecBackend.ContainerRm()` (backed by `daemonContainerRm()`), which is called
after this, is executed with the `ForceRemove` option set, which calls
`daemon.cleanupContainer()` with `ForceRemove` set, which also results in
`daemon.Kill()` being called:
1a0c15abbb/daemon/delete.go (L84-L95)

This makes the `ExecBackend.ContainerKill()` redundant, so removing this from
the interface.

While looking at this code, one (possible) race-condition was found in
`daemon.cleanupContainer()`, where `daemon.Kill()` could return a `errdefs.Conflict`
if the container was already stopped. An extra check was added for this case to
prevent `daemon.cleanupContainer()` from terminating early.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-05 17:36:41 +01:00
..
buildargs.go Sort unconsumed build arguments before usage 2023-07-09 03:23:06 -04:00
buildargs_test.go builder/dockerfile: add "ALL_PROXY" to list of default build args 2021-04-24 18:25:16 +02:00
builder.go builder/dockerfile: errmsg: quote build target 2023-11-02 09:38:14 +01:00
builder_unix.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
builder_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
containerbackend.go builder: remove redundant ExecBackend.ContainerKill() 2024-01-05 17:36:41 +01:00
copy.go pkg/containerfs: deprecate ResolveScopedPath 2024-01-02 15:32:31 +01:00
copy_test.go builder/dockerfile: use string-literals for easier grep'ing 2023-07-05 12:25:59 +02:00
copy_unix.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
copy_windows.go builder/dockerfile: use string-literals for easier grep'ing 2023-07-05 12:25:59 +02:00
dispatchers.go image: implement CheckOS, deprecate pkg/system IsOSSupported 2023-09-07 22:14:44 +02:00
dispatchers_test.go api/types: move ContainerCreateConfig, ContainerRmConfig to api/types/backend 2023-12-05 16:41:36 +01:00
dispatchers_unix.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
dispatchers_unix_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
dispatchers_windows.go builder/dockerfile: format code with gofumpt 2023-06-29 00:25:21 +02:00
dispatchers_windows_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
evaluator.go image: implement CheckOS, deprecate pkg/system IsOSSupported 2023-09-07 22:14:44 +02:00
evaluator_test.go builder/dockerfile: format code with gofumpt 2023-06-29 00:25:21 +02:00
imagecontext.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
imagecontext_test.go builder: Don't store context in struct 2022-11-03 12:22:46 +01:00
imageprobe.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
internals.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
internals_linux.go migrate to github.com/moby/sys/user 2023-10-24 15:45:02 +02:00
internals_linux_test.go builder/dockerfile: format code with gofumpt 2023-06-29 00:25:21 +02:00
internals_test.go builder/dockerfile: format code with gofumpt 2023-06-29 00:25:21 +02:00
internals_windows.go builder/dockerfile: format code with gofumpt 2023-06-29 00:25:21 +02:00
internals_windows_test.go remove pre-go1.17 build-tags 2023-05-19 20:38:51 +02:00
metrics.go goimports: fix imports 2019-09-18 12:56:54 +02:00
mockbackend_test.go builder: remove redundant ExecBackend.ContainerKill() 2024-01-05 17:36:41 +01:00
utils_test.go builder/dockerfile: format code with gofumpt 2023-06-29 00:25:21 +02:00