aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/scripts/pack.scm38
1 files changed, 25 insertions, 13 deletions
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index a9e9e7a415..698af73d28 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -560,19 +560,31 @@ the image."
(docker-image
(string-append name ".tar"
(compressor-extension compressor))
- (list (docker-image-layer
- "pack-docker-image-layer"
- (with-store store
- (let ((output
- (build-derivations store (list profile)))
- (path
- (derivation-output-path
- (match (derivation-outputs profile)
- (((name . derivation-output))
- derivation-output)))))
- (requisites store (list path))))
- ;;#:extra-files directives
- ))
+ (with-store store
+ (let* ((output
+ (build-derivations store (list profile)))
+ (path
+ (derivation-output-path
+ (match (derivation-outputs profile)
+ (((name . derivation-output))
+ derivation-output))))
+ (refs
+ (references store path))
+ (reqs
+ (requisites store (list path))))
+
+ (list (docker-image-layer
+ "pack-docker-image-layer"
+ (sort (filter (lambda (path)
+ (not (member path refs)))
+ reqs)
+ string<?))
+ (docker-image-layer
+ "pack-docker-image-layer"
+ (sort (filter (lambda (path)
+ (member path refs))
+ reqs)
+ string<?)))))
#:repository tag
#:environment environment
#:entry-point (and entry-point