[bug#78210] guix: include store parent dirs in docker layer
Commit Message
* 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
---
guix/docker.scm | 4 ++--
guix/scripts/pack.scm | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
(use-modules (guix docker) (guix build store-copy)
@@ -580,9 +581,10 @@ (define* (docker-image name profile
(,source -> ,target))))))
(define directives
- ;; Create a /tmp directory, as some programs expect it, and
- ;; create SYMLINKS.
+ ;; Create /tmp and %store-prefix directories, as some
+ ;; programs expect them, and create SYMLINKS.
`((directory "/tmp" ,(getuid) ,(getgid) #o1777)
+ (directory #$(%store-prefix) ,(getuid) ,(getgid) #o755)
,@(append-map symlink->directives '#$symlinks)))
(define (form-entry-point prefix entry-point
entry-point-argument)
base-commit: 096dedd0bb13523002c814b001429c2f65b6f10d
@@ -365,10 +365,10 @@ (define* (build-docker-image image paths prefix
(apply invoke "tar" "-cf" "../layer.tar"
`(,@transformation-options
,@(tar-base-options)
- ,@(if max-layers '() paths)
,@(scandir "."
(lambda (file)
- (not (member file '("." ".."))))))))
+ (not (member file '("." "..")))))
+ ,@(if max-layers '() paths))))
(delete-file-recursively "extra")))
;; It is possible for "/" to show up in the archive, especially
when
@@ -551,7 +551,8 @@ (define* (docker-image name profile
(guix build store-copy)
(guix build utils) ;for
%xz-parallel-args
(guix profiles)
- (guix search-paths))
+ (guix search-paths)
+ (guix store))
#:select? not-config?))
#~(begin