<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 24, 2020 at 5:09 AM Mattia Rizzolo <<a href="mailto:mattia@mapreri.org">mattia@mapreri.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, May 22, 2020 at 11:35:51AM -0500, Greg Chabala wrote:<br>
> Just discovered diffoscope and was giving it a try, but I was surprised to<br>
> see how large the docker image is:<br>
> <br>
> $ docker run --rm -t -w $(pwd) -v $(pwd):$(pwd):ro \<br>
…<br>
>    ]  210.7MB/1.212GB<br>
> <br>
> I considered opening an issue for this, but I thought I'd ask about it<br>
> first. I don't think 1GB+ image layers is a good idea. Was this necessary<br>
> for some reason?<br>
<br>
"Unfortunately" that's not a bug.<br>
Diffoscope uses **many** external programs, many of which are quite<br>
huge.  They are all optional, but if they aren't installed diffoscope<br>
would only be able to output an hex dump, which is rarely useful.<br></blockquote><div><br></div><div>I considered this. But in the land of linux tools, one gigabyte is many, many tools. I suspect more is being installed than is truly needed.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
To give you a list of used tools (from `diffoscope --list-tools):<br>
    Rscript, abootimg, apksigner, apktool, bsdtar, bzip2, cbfstool,<br>
    cd-iccdump, cmp, compare, convert, db_dump, diff, docx2txt, dumppdf,<br>
    dumpxsb, enjarify, fdtdump, ffprobe, getfacl, ghc, gifbuild, gpg,<br>
    gzip, h5dump, identify, img2txt, isoinfo, javap, js-beautify,<br>
    kbxutil, lipo, llvm-bcanalyzer, llvm-dis, lsattr, lz4, msgunfmt, nm,<br>
    objcopy, objdump, ocamlobjinfo, odt2txt, oggDump, openssl, otool,<br>
    pdftotext, pedump, pgpdump, ppudump, procyon, ps2ascii, readelf,<br>
    rpm2cpio, showttf, sng, sqlite3, ssconvert, ssh-keygen, stat,<br>
    tcpdump, unsquashfs, wasm2wat, xxd, xz, zipinfo, zipnote, zstd<br><br></blockquote><div><br></div><div>Any idea about which tools might be the worst citizens with regard to disk space?</div><div><br></div><div>When I tried building the Dockerfile myself, I ran out of disk space; I had 9GB free prior to starting. But that's likely because the 'apt-get update' and subsequent cleanup are in different layers.</div><div><br></div><div>Following my initial email I found this issue:  <a href="https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/104">https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/104</a></div><div><br></div><div>and I used the improved Dockerfile in the comments to build locally. But I was still left with a 3.5GB image.</div><div><br></div><div>I hope that the changes from #104 get implemented, but there's likely more to be done. A <a href="https://docs.docker.com/develop/develop-images/multistage-build/">multi-stage build</a> might help to separate building dependencies from runtime dependencies in the final image.</div></div></div>