pack: Add '--entry-point'.

* guix/scripts/pack.scm (self-contained-tarball): Add #:entry-point and
warn when it's true.
(squashfs-image): Add #:entry-point and honor it.
(docker-image): Add #:entry-point and honor it.
(%options, show-help): Add '--entry-point'.
(guix-pack): Honor '--entry-point' and pass #:entry-point to BUILD-IMAGE.
* gnu/tests/docker.scm (run-docker-test): Test 'docker run' with the
default entry point.
(build-tarball&run-docker-test): Pass #:entry-point to 'docker-image'.
* doc/guix.texi (Invoking guix pack): Document it.
* gnu/tests/singularity.scm (run-singularity-test)["singularity run"]:
New test.
(build-tarball&run-singularity-test): Pass #:entry-point to
'squashfs-image'.
This commit is contained in:
Ludovic Courtès 2019-06-04 18:43:23 +02:00 committed by Ludovic Courtès
parent 08814aec6a
commit a0f352b30f
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
4 changed files with 85 additions and 7 deletions

View file

@ -101,7 +101,7 @@ inside %DOCKER-OS."
marionette))
(test-equal "Load docker image and run it"
"hello world"
'("hello world" "hi!")
(marionette-eval
`(begin
(define slurp
@ -117,12 +117,16 @@ inside %DOCKER-OS."
(repository&tag (string-drop raw-line
(string-length
"Loaded image: ")))
(response (slurp
,(string-append #$docker-cli "/bin/docker")
"run" "--entrypoint" "bin/Guile"
repository&tag
"/aa.scm")))
response))
(response1 (slurp
,(string-append #$docker-cli "/bin/docker")
"run" "--entrypoint" "bin/Guile"
repository&tag
"/aa.scm"))
(response2 (slurp ;default entry point
,(string-append #$docker-cli "/bin/docker")
"run" repository&tag
"-c" "(display \"hi!\")")))
(list response1 response2)))
marionette))
(test-end)
@ -161,6 +165,7 @@ standard output device and then enters a new line.")
(tarball (docker-image "docker-pack" profile
#:symlinks '(("/bin/Guile" -> "bin/guile")
("aa.scm" -> "a.scm"))
#:entry-point "bin/guile"
#:localstatedir? #t)))
(run-docker-test tarball)))