Open meilier opened 1 year ago
Thanks for reaching out, I can reproduce the issue, @meilier.
No problem with a simple tar but with an xz-compressed one.
Cc: @mtrmac
Yes, the tarball_src.go
link is accurate: only uncompressed and gzip-compressed inputs could ever have worked.
Given that the man page has been documenting Bzip (not even Bzip2) and Xz since 2017, that’s before Podman was named Podman, I have to wonder whether we shouldn’t just stop advertising this in the documentation instead of implementing this.
There are two aspects to supporting Xz:
tarball:
transport to generate an uncompressed layer with an uncompressed MIME type, probably by using a temporary file in /var/tmp
. That’s costly enough that it makes sense to me to recommend to users not to use Xz in the first place — using Gzip (or, assuming we add support, Zstd) would be faster, assuming the CPU can decompress faster than the disks can write. So, given the 2017 history, and the awkwardness of truly and cleanly supporting Xz, I’m a bit tempted to declare this, or at least the Bzip/Xz parts, a documentation bug; and to only consider adding Zstd support.
OTOH implementing Xz, either naively in a way that triggers the warning, or correctly with a temporary file, would not really be that much work — it’s mostly a question of need/prioritization.
I'm OK with changing docs instead.
A friendly reminder that this issue had no activity for 30 days.
@meilier Interested in opening a Docs PR?
I'd argue that it shouldn't consider docs only. I'm ok with no support for xz
/bzip2
but I think podman import
should issue error then just like for any other unsupported format. Currently it gives false impression that it all works just fine. For example I've been using images imported and published from tar.xz
in podman
for years until it turned out it doesn't actually work in docker
only because single hash is wrong (#18716).
I'm ok with no support for
xz
/bzip2
but I thinkpodman import
should issue error then just like for any other unsupported format.
That’s a fair point, yes; the tarball
transport in c/image should reject images with a non-gzip compression, and Podman can just update documentation.
Issue Description
podman import xz compressed rootfs can not save and load again.
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
import success
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
Try to seach and locate, it seems like wrong compression algorithm is used in containers/image, result in a wrong diffID saved.
But when I try decompress it, import becomes very slow, there may be too many decompressiones during import.
https://github.com/containers/image/blob/main/tarball/tarball_src.go#L88