DockerCLI/cli/command
Alano Terblanche 30a73ff19c
fix: ctx should cancel image pull on run
This patch fixes the context cancellation
behaviour for the `runContainer` function,
specifically the `createContainer` function
introduced in this commit 991b1303da.

It delays stripping the `cancel` from the context
passed into the `runContainer` function so that
the `createContainer` function can be cancelled
gracefully by a SIGTERM/SIGINT.

This is especially true when the requested image
does not exist and `docker run` needs to `pull`
the image before creating the container.

Although this patch does gracefully cancel
the `runContainer` function it does not address
the root cause. Some functions in the call path
are not context aware, such as `pullImage`.

Future work would still be necessary to ensure
a consistent behaviour in the CLI.

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
2024-11-28 09:53:04 +01:00
..
builder test spring-cleaning 2024-07-04 01:35:12 +02:00
checkpoint cli: improve argument validation output 2024-07-05 03:35:14 +02:00
commands remove exec, push, pull, ps, images, info from "legacy" commands 2022-04-08 16:55:39 +02:00
completion cli/command: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
config update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
container fix: ctx should cancel image pull on run 2024-11-28 09:53:04 +01:00
context update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
formatter update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
idresolver update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
image vendor: github.com/docker/docker e5c2b5e10d68 (master, v28.0.0-dev) 2024-11-20 15:54:27 +01:00
inspect update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
manifest cli/command: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
network update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
node update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
plugin update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
registry cli/command: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
secret update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
service update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
stack update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
swarm cli/command: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
system update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
task cli/command: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
testdata Dynamically register kubernetes context store endpoint type. 2019-05-20 13:28:11 +01:00
trust update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
volume update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
cli.go update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
cli_options.go add support for DOCKER_CUSTOM_HEADERS env-var (experimental) 2024-07-19 15:04:26 +02:00
cli_options_test.go golangci-lint: enable thelper linter 2023-11-20 16:02:17 +01:00
cli_test.go cli/command: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
context.go update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
context_test.go update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
defaultcontextstore.go update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
defaultcontextstore_test.go update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
registry.go Merge pull request #5550 from thaJeztah/login_minor_refactor 2024-10-21 23:23:06 +02:00
registry_test.go linting: fmt.Sprintf can be replaced with string concatenation (perfsprint) 2024-06-10 21:19:32 +02:00
telemetry.go OTel: implement missing MeterProvider `ForceFlush` 2024-05-15 00:05:31 +01:00
telemetry_docker.go update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
telemetry_docker_test.go command: change drive to lowercase for wsl path 2024-09-18 10:59:08 +01:00
telemetry_options.go cli: make initializing the global meter- and tracing providers optional 2024-06-24 15:44:20 +02:00
telemetry_utils.go telemetry: pass otel errors to the otel handler for shutdown and force flush 2024-09-17 10:47:04 -05:00
telemetry_utils_test.go cli/command: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
trust.go Refactor content_trust cli/flags handling 2018-03-08 15:00:43 -05:00
utils.go update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
utils_test.go tests: cleanup table test names 2024-11-27 16:46:34 +00:00