mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Implement build cancellation
Add the capability to cancel the build by disconnecting the client. This adds a `cancelled` channel which is used to signal that a build should halt. The build is halted by sending a Kill signal and noticing that the cancellation channel is closed. This first pass implementation does not allow cancellation during a pull, but that will come in a subsequent PR. * Add documentation of cancellation to cli and API * Protect job cancellation with sync.Once * Add TestBuildCancelationKillsSleep * Add test case for build cancellation of RUN statements. Signed-off-by: Peter Waller <p@pwaller.net>
This commit is contained in:
@@ -599,6 +599,12 @@ in cases where the same set of files are used for multiple builds. The path
|
||||
must be to a file within the build context. If a relative path is specified
|
||||
then it must to be relative to the current directory.
|
||||
|
||||
If the Docker client loses connection to the daemon, the build is canceled.
|
||||
This happens if you interrupt the Docker client with `ctrl-c` or if the Docker
|
||||
client is killed for any reason.
|
||||
|
||||
> **Note:** Currently only the "run" phase of the build can be canceled until
|
||||
> pull cancelation is implemented).
|
||||
|
||||
See also:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user