mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
docker: 'build-docker-image' accepts an optional #:entry-point.
* guix/docker.scm (config): Add #:entry-point and honor it. (build-docker-image): Likewise.
This commit is contained in:
parent
9fcfe30d28
commit
7ff4fde257
1 changed files with 11 additions and 4 deletions
|
@ -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 @@ (define (repositories path id)
|
|||
`((,(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 @@ (define (config layer time arch)
|
|||
`((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 @@ (define* (build-docker-image image paths prefix
|
|||
(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 @@ (define* (build-docker-image image paths prefix
|
|||
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 @@ (define transformation-options
|
|||
(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))))
|
||||
|
|
Loading…
Reference in a new issue