From: "Ludovic Courtès" <ludo@gnu.org>
To: 35697@debbugs.gnu.org
Cc: Chris Marusich <cmmarusich@gmail.com>
Subject: [bug#35697] [PATCH 7/8] docker: 'build-docker-image' accepts an optional #:entry-point.
Date: Sun, 12 May 2019 12:38:01 +0200 [thread overview]
Message-ID: <20190512103802.17032-7-ludo@gnu.org> (raw)
In-Reply-To: <20190512103802.17032-1-ludo@gnu.org>
* guix/docker.scm (config): Add #:entry-point and honor it.
(build-docker-image): Likewise.
---
guix/docker.scm | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/guix/docker.scm b/guix/docker.scm
index c6e9c6fee5..7fe83d9797 100644
--- a/guix/docker.scm
+++ b/guix/docker.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -73,7 +73,7 @@
`((,(generate-tag path) . ((latest . ,id)))))
;; See https://github.com/opencontainers/image-spec/blob/master/config.md
-(define (config layer time arch)
+(define* (config layer time arch #:key entry-point)
"Generate a minimal image configuration for the given LAYER file."
;; "architecture" must be values matching "platform.arch" in the
;; runtime-spec at
@@ -81,7 +81,9 @@
`((architecture . ,arch)
(comment . "Generated by GNU Guix")
(created . ,time)
- (config . #nil)
+ (config . ,(if entry-point
+ `((entrypoint . ,entry-point))
+ #nil))
(container_config . #nil)
(os . "linux")
(rootfs . ((type . "layers")
@@ -110,6 +112,7 @@ return \"a\"."
(transformations '())
(system (utsname:machine (uname)))
database
+ entry-point
compressor
(creation-time (current-time time-utc)))
"Write to IMAGE a Docker image archive containing the given PATHS. PREFIX
@@ -118,6 +121,9 @@ must be a store path that is a prefix of any store paths in PATHS.
When DATABASE is true, copy it to /var/guix/db in the image and create
/var/guix/gcroots and friends.
+When ENTRY-POINT is true, it must be a list of strings; it is stored as the
+entry point in the Docker image JSON structure.
+
SYMLINKS must be a list of (SOURCE -> TARGET) tuples describing symlinks to be
created in the image, where each TARGET is relative to PREFIX.
TRANSFORMATIONS must be a list of (OLD -> NEW) tuples describing how to
@@ -227,7 +233,8 @@ SRFI-19 time-utc object, as the creation time in metadata."
(with-output-to-file "config.json"
(lambda ()
(scm->json (config (string-append id "/layer.tar")
- time arch))))
+ time arch
+ #:entry-point entry-point))))
(with-output-to-file "manifest.json"
(lambda ()
(scm->json (manifest prefix id))))
--
2.21.0
next prev parent reply other threads:[~2019-05-12 10:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-12 10:30 [bug#35697] [PATCH 0/8] Make 'guix system docker-image' readily usable Ludovic Courtès
2019-05-12 10:37 ` [bug#35697] [PATCH 1/8] system: Export 'operating-system-default-essential-services' Ludovic Courtès
2019-05-12 10:37 ` [bug#35697] [PATCH 2/8] linux-container: Improve filtering of unnecessary file systems Ludovic Courtès
2019-05-12 10:37 ` [bug#35697] [PATCH 3/8] services: 'gc-root-service-type' now has a default value Ludovic Courtès
2019-05-12 10:37 ` [bug#35697] [PATCH 4/8] linux-container: Do not add %CONTAINER-FILE-SYSTEMS to Docker image OSes Ludovic Courtès
2019-05-12 10:37 ` [bug#35697] [PATCH 5/8] linux-container: Compute essential services for THIS-OPERATING-SYSTEM Ludovic Courtès
2019-05-12 10:38 ` [bug#35697] [PATCH 6/8] system: Add 'operating-system-with-gc-roots' Ludovic Courtès
2019-05-12 10:38 ` Ludovic Courtès [this message]
2019-05-12 10:38 ` [bug#35697] [PATCH 8/8] vm: 'system-docker-image' provides an entry point Ludovic Courtès
2019-05-15 14:37 ` bug#35697: [PATCH 0/8] Make 'guix system docker-image' readily usable Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190512103802.17032-7-ludo@gnu.org \
--to=ludo@gnu.org \
--cc=35697@debbugs.gnu.org \
--cc=cmmarusich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.