Ludovic Courtès writes: >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -2438,6 +2438,12 @@ Read a list of store file names from the standard input, one per line, >> and write on the standard output the subset of these files missing from >> the store. >> >> +@item --export-docker-image=@var{directory} >> +@cindex docker, export >> +Recursively export the specified store directory as a Docker image in >> +tar archive format. The generated archive can be loaded by Docker using >> +@command{docker load}. > > Maybe “as a Docker image in tar archive format, as specified in > @uref{http://…, version 1.0 of the Foo Bar Spec}.” Okay. > I would be in favor of --format=FMT, where FMT can be one of “nar” or > “docker”. Maybe there’ll be others in the future. WDYT? Sounds good. > The paragraph that says “Archives are stored in the “normalized archive” > or “nar” format,“ should be updated. > > Also, it seems that ‘-f docker’ would always imply ’-r’, right? That’s > reasonable but would be worth mentioning. Okay. >> +(define (hexencode bv) >> + "Return the hexadecimal representation of the bytevector BV." >> + (format #f "~{~2,'0x~}" (bytevector->u8-list bv))) > > Maybe use ‘bytevector->base16-string’ from (guix utils) instead. Ah, didn’t know about this one. >> +(define spec-version "1.0") > > Please add the URL to said spec as a comment. I added a clarifying comment (because confusingly this is NOT the version of the Docker image spec). >> +;; TODO: heroically copied from guix/script/pull.scm >> +(define (temporary-directory) > > Alternatively, there’s ‘call-with-temporary-directory’ in (guix utils). > :-) Neat! >> + (and (zero? (apply system* "tar" "-cf" "layer.tar" >> + (cons "../bin" items))) >> + (delete-file "../bin")))) > > This reminds me we should steal this code of Mark’s sometime: > > https://github.com/spk121/guile100/blob/master/code/tar2.scm Yes, this would be nice. Attached is a new patch with all requested changes and a couple of fixes (generated images now have proper names and tags). ~~ Ricardo