bug#78210: [PATCH] guix: include store parent dirs in docker layer

Message ID 87o6v5md78.fsf@gnu.org
State New
Headers
Series bug#78210: [PATCH] guix: include store parent dirs in docker layer |

Commit Message

Ludovic Courtès June 3, 2025, 8:39 a.m. UTC
  Hi Ray,

Ray Miller <ray@1729.org.uk> writes:

> * guix/scripts/pack.scm: add store directory to the docker
> layer.
> * guix/docker.scm: change order of arguments to tar so parent
> directories are added before their contents.
>
> Fixes <https://issues.guix.gnu.org/78210>
>
> Change-Id: I2b103c59981e828c965564ccc5d2415b00a7e52e

I tweaked the commit log and applied it with the changes below.

Thanks!

Ludo’.
  

Patch

diff --git a/guix/docker.scm b/guix/docker.scm
index 9911bb84bb5..bb6d896a635 100644
--- a/guix/docker.scm
+++ b/guix/docker.scm
@@ -365,6 +365,7 @@  (define* (build-docker-image image paths prefix
                 (apply invoke "tar" "-cf" "../layer.tar"
                        `(,@transformation-options
                          ,@(tar-base-options)
+                         ;; Add parent directories before their contents.
                          ,@(scandir "."
                                     (lambda (file)
                                       (not (member file '("." "..")))))
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index e69316089d8..857cb46af37 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -580,7 +580,7 @@  (define* (docker-image name profile
                      (,source -> ,target))))))
 
             (define directives
-              ;; Create /tmp and %store-prefix directories, as some
+              ;; Create the /tmp and %store-prefix directories, as some
               ;; programs expect them, and create SYMLINKS.
               `((directory "/tmp" ,(getuid) ,(getgid) #o1777)
                 (directory #$(%store-prefix) ,(getuid) ,(getgid) #o755)