me
/
guix
Archived
1
0
Fork 0

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
master
Zheng Junjie 2024-05-27 13:53:01 +08:00
parent 425cf1fbe2
commit 2b2337f275
No known key found for this signature in database
GPG Key ID: 3B5AA993E1A2DFF0
1 changed files with 13 additions and 12 deletions

View File

@ -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)))