-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] Add commit compression type support #4061
base: main
Are you sure you want to change the base?
Conversation
CI is failing right now - bustage will be fixed by #4058 |
docs/command-reference.md
Outdated
@@ -759,6 +759,7 @@ Flags: | |||
- :whale: `-m, --message`: Commit message | |||
- :whale: `-c, --change`: Apply Dockerfile instruction to the created image (supported directives: [CMD, ENTRYPOINT]) | |||
- :whale: `-p, --pause`: Pause container during commit (default: true) | |||
- :whale: `--compression`: Commit compression algorithm,(supported value: zstd or gzip) (default: gzip) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Docker have this? If not this has to be :nerd_face:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.docker.com/reference/cli/docker/container/commit/
Docker current is not support. @thaJeztah Not sure if I can consult you? Will docker commit add this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @lengrongfu ,
If it's nerd_face
, it can be changed to
- :nerd_face: `--compression`: Commit compression algorithm,(supported value: zstd or gzip) (default: gzip)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update done.
func createDiff(ctx context.Context, name string, sn snapshots.Snapshotter, cs content.Store, comparer diff.Comparer, compression string) (ocispec.Descriptor, digest.Digest, error) { | ||
opts := make([]diff.Opt, 0) | ||
mediaType := images.MediaTypeDockerSchema2LayerGzip | ||
if compression == "zstd" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should raise an error if the string is invalid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add verify this field compression value whether is gzip or zstd.
Signed-off-by: rongfu.leng <[email protected]>
Fix #4060
Use zstd compression can shorten commit time. current containerd v2 having support
zstd
commit type, but containerd v1 version don't support.Test case:
to view blob type.