aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorZheng Junjie <zhengjunjie@iscas.ac.cn>2024-05-27 13:53:01 +0800
committerZheng Junjie <zhengjunjie@iscas.ac.cn>2024-06-06 13:55:20 +0800
commit2b2337f275a6421a0d0964c54987df4ac74162e6 (patch)
tree7de01901ff31f38dc0f15322523182268b98e43f /gnu/services
parent425cf1fbe2fff25bda1b5eb948ce01170d23ab6a (diff)
downloadguix-2b2337f275a6421a0d0964c54987df4ac74162e6.tar.gz
guix-2b2337f275a6421a0d0964c54987df4ac74162e6.zip
services: oci-container: Fix provided image is string.
gnu/services/docker.scm (oci-container-shepherd-service): When image is oci-image, call %oci-image-loader. Change-Id: I26105e82643affe9e7037975e42ec9690089545b
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/docker.scm25
1 files changed, 13 insertions, 12 deletions
diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm
index 7aff8dcc5f..cc1201508c 100644
--- a/gnu/services/docker.scm
+++ b/gnu/services/docker.scm
@@ -687,18 +687,19 @@ operating-system, gexp or file-like records but ~a was found")
(if (oci-image? image) name image) "."))
(start
#~(lambda ()
- (when #$(oci-image? image)
- (invoke #$(%oci-image-loader
- name image image-reference)))
- (fork+exec-command
- ;; docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
- (list #$docker "run" "--rm" "--name" #$name
- #$@options #$@extra-arguments
- #$image-reference #$@command)
- #:user #$user
- #:group #$group
- #:environment-variables
- (list #$@host-environment))))
+ #$@(if (oci-image? image)
+ #~((invoke #$(%oci-image-loader
+ name image image-reference)))
+ #~())
+ (fork+exec-command
+ ;; docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
+ (list #$docker "run" "--rm" "--name" #$name
+ #$@options #$@extra-arguments
+ #$image-reference #$@command)
+ #:user #$user
+ #:group #$group
+ #:environment-variables
+ (list #$@host-environment))))
(stop
#~(lambda _
(invoke #$docker "rm" "-f" #$name)))