mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
pack: Include store parent directories in the Docker layer.
Fixes <https://issues.guix.gnu.org/78210>. This patch adds the /gnu and /gnu/store directories to the Docker layer created by ‘guix pack -f docker …’, which enables the Docker image to be used to create an AWS Lambda function. Without the patch, creating the AWS Lambda function fails with this error: "MissingParentDirectory: Parent directory does not exist for file: gnu/store/…-info-dir/" * guix/scripts/pack.scm (docker-image)[build]: Add store directory to the docker layer. * guix/docker.scm (build-docker-image): Change order of arguments to ‘tar’ so parent directories are added before their contents. Change-Id: I2b103c59981e828c965564ccc5d2415b00a7e52e Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
ef3b963a54
commit
b48b2bcf42
2 changed files with 6 additions and 4 deletions
|
@ -365,10 +365,11 @@ added to image as a layer."
|
||||||
(apply invoke "tar" "-cf" "../layer.tar"
|
(apply invoke "tar" "-cf" "../layer.tar"
|
||||||
`(,@transformation-options
|
`(,@transformation-options
|
||||||
,@(tar-base-options)
|
,@(tar-base-options)
|
||||||
,@(if max-layers '() paths)
|
;; Add parent directories before their contents.
|
||||||
,@(scandir "."
|
,@(scandir "."
|
||||||
(lambda (file)
|
(lambda (file)
|
||||||
(not (member file '("." ".."))))))))
|
(not (member file '("." "..")))))
|
||||||
|
,@(if max-layers '() paths))))
|
||||||
(delete-file-recursively "extra")))
|
(delete-file-recursively "extra")))
|
||||||
|
|
||||||
;; It is possible for "/" to show up in the archive, especially when
|
;; It is possible for "/" to show up in the archive, especially when
|
||||||
|
|
|
@ -580,9 +580,10 @@ layers."
|
||||||
(,source -> ,target))))))
|
(,source -> ,target))))))
|
||||||
|
|
||||||
(define directives
|
(define directives
|
||||||
;; Create a /tmp directory, as some programs expect it, and
|
;; Create the /tmp and %store-prefix directories, as some
|
||||||
;; create SYMLINKS.
|
;; programs expect them, and create SYMLINKS.
|
||||||
`((directory "/tmp" ,(getuid) ,(getgid) #o1777)
|
`((directory "/tmp" ,(getuid) ,(getgid) #o1777)
|
||||||
|
(directory #$(%store-prefix) ,(getuid) ,(getgid) #o755)
|
||||||
,@(append-map symlink->directives '#$symlinks)))
|
,@(append-map symlink->directives '#$symlinks)))
|
||||||
|
|
||||||
(define (form-entry-point prefix entry-point entry-point-argument)
|
(define (form-entry-point prefix entry-point entry-point-argument)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue