Skip to content

Conversation

@thaJeztah
Copy link
Member

relates to:

deprecate "--pause" flag on docker commit in favor of "--no-pause"

Commit moby@17d870b (API v1.13, docker v1.1.0) changed the default to pause containers during commit, keeping the behavior opt-in for older API versions. This version-gate was removed in moby@1b1147e because API versions lower than v1.23 were no longer supported.

This patch deprecates the --pause flag in favor of a --no-pause flag to be more explicit on the default. The old --pause flag is marked deprecated but still functional. Using the deprecated flag will print a warning, and an error is produced when trying to use both the old and new flag;

docker commit --pause mycontainer
Flag --pause has been deprecated, and enabled by default. Use --no-pause to disable pausing during commit.

docker commit --pause=false mycontainer
Flag --pause has been deprecated, and enabled by default. Use --no-pause to disable pausing during commit.

docker commit --pause --no-pause mycontainer
Flag --pause has been deprecated, use --no-pause instead
conflicting options: --no-pause and --pause cannot be used together

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Deprecate `--pause` flag on docker commit in favor of `--no-pause`.

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.0.0 milestone Sep 22, 2025
@thaJeztah thaJeztah requested a review from a team as a code owner September 22, 2025 13:33
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/container/commit.go 58.33% 4 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Commit [moby@17d870b] (API v1.13, docker v1.1.0) changed the default to pause
containers during commit, keeping the behavior opt-in for older API versions.
This version-gate was removed in [moby@1b1147e] because API versions lower
than v1.23 were no longer supported.

This patch deprecates the `--pause` flag in favor of a `--no-pause` flag to
be more explicit on the default. The old `--pause` flag is marked deprecated
but still functional. Using the deprecated flag will print a warning, and an
error is produced when trying to use both the old and new flag;

    docker commit --pause mycontainer
    Flag --pause has been deprecated, and enabled by default. Use --no-pause to disable pausing during commit.

    docker commit --pause=false mycontainer
    Flag --pause has been deprecated, and enabled by default. Use --no-pause to disable pausing during commit.

    docker commit --pause --no-pause mycontainer
    Flag --pause has been deprecated, use --no-pause instead
    conflicting options: --no-pause and --pause cannot be used together

[moby@17d870b]: moby/moby@17d870b
[moby@1b1147e]: moby/moby@1b1147e

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

oh! My mistake; linting error;

72.53 cli/command/container/commit.go:41:13: use-errors-new: replace fmt.Errorf by errors.New (revive)
72.53 					return fmt.Errorf("conflicting options: --no-pause and --pause cannot be used together")
72.53 					       ^

Should be fixed now

@thaJeztah
Copy link
Member Author

I'll bring this one in; after moby/moby#51019, I need to make some follow-up changes, but contemplating to include this / a variant of this in a 28.x release to somewhat speed-up deprecation.

@thaJeztah thaJeztah merged commit e241f53 into docker:master Sep 23, 2025
159 of 164 checks passed
@thaJeztah thaJeztah deleted the no_pause branch September 23, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants