unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: 52550@debbugs.gnu.org
Cc: Mathieu Othacehe <othacehe@gnu.org>
Subject: [bug#52550] [PATCH 07/10] scripts: system: Deprecate the docker-image command.
Date: Thu, 16 Dec 2021 14:06:46 +0100	[thread overview]
Message-ID: <20211216130649.30285-7-othacehe@gnu.org> (raw)
In-Reply-To: <20211216130649.30285-1-othacehe@gnu.org>

* guix/scripts/system.scm (system-derivation-for-action): Use the image API to
generate the docker images and deprecate the docker-image command.
(process-action): Ditto.
* doc/guix.texi (Invoking guix system): Adapt it.
---
 doc/guix.texi           | 19 +++++--------------
 guix/scripts/system.scm | 22 ++++++++++++----------
 2 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index dd991542cf..f0f5538427 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -34986,15 +34986,6 @@ QEMU monitor and the VM.
 @cindex System images, creation in various formats
 @cindex Creating system images in various formats
 @item image
-@itemx docker-image
-Return a virtual machine, disk image, or Docker image of the operating
-system declared in @var{file} that stands alone.  By default,
-@command{guix system} estimates the size of the image needed to store
-the system, but you can use the @option{--image-size} option to specify
-a value.  Docker images are built to contain exactly what they need, so
-the @option{--image-size} option is ignored in the case of
-@code{docker-image}.
-
 @cindex image, creating disk images
 The @code{image} command can produce various image types.  The
 image type can be selected using the @option{--image-type} option.  It
@@ -35040,11 +35031,11 @@ uses the SeaBIOS BIOS by default, expecting a bootloader to be installed
 in the Master Boot Record (MBR).
 
 @cindex docker-image, creating docker images
-When using @code{docker-image}, a Docker image is produced.  Guix builds
-the image from scratch, not from a pre-existing Docker base image.  As a
-result, it contains @emph{exactly} what you define in the operating
-system configuration file.  You can then load the image and launch a
-Docker container using commands like the following:
+When using the @code{docker} image type, a Docker image is produced.
+Guix builds the image from scratch, not from a pre-existing Docker base
+image.  As a result, it contains @emph{exactly} what you define in the
+operating system configuration file.  You can then load the image and
+launch a Docker container using commands like the following:
 
 @example
 image_id="$(docker load < guix-system-docker-image.tar.gz)"
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 1db788a534..a5d9bb4779 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -713,16 +713,14 @@ (define* (system-derivation-for-action image action
                                                   image-size
                                                   (* 70 (expt 2 20)))
                                               #:mappings mappings))
-      ((image disk-image vm-image)
+      ((image disk-image vm-image docker-image)
        (when (eq? action 'disk-image)
          (warning (G_ "'disk-image' is deprecated: use 'image' instead~%")))
        (when (eq? action 'vm-image)
          (warning (G_ "'vm-image' is deprecated: use 'image' instead~%")))
-       (lower-object (system-image image)))
-      ((docker-image)
-       (system-docker-image os
-                            #:memory-size 1024
-                            #:shared-network? container-shared-network?)))))
+       (when (eq? action 'docker-image)
+         (warning (G_ "'docker-image' is deprecated: use 'image' instead~%")))
+       (lower-object (system-image image))))))
 
 (define (maybe-suggest-running-guix-pull)
   "Suggest running 'guix pull' if this has never been done before."
@@ -1214,11 +1212,14 @@ (define save-provenance?
          (label       (assoc-ref opts 'label))
          (image-type  (lookup-image-type-by-name
                        (assoc-ref opts 'image-type)))
-         (image       (let* ((image-type (if (eq? action 'vm-image)
-                                            qcow2-image-type
-                                            image-type))
+         (image       (let* ((image-type (case action
+                                           ((vm-image) qcow2-image-type)
+                                           ((docker-image) docker-image-type)
+                                           (else image-type)))
                             (image-size (assoc-ref opts 'image-size))
                             (volatile?  (assoc-ref opts 'volatile-root?))
+                            (shared-network?
+                               (assoc-ref opts 'container-shared-network?))
                             (base-image (if (operating-system? obj)
                                             (os->image obj
                                                        #:type image-type)
@@ -1228,7 +1229,8 @@ (define save-provenance?
                                       (image-with-label base-image label)
                                       base-image))
                          (size image-size)
-                         (volatile-root? volatile?))))
+                         (volatile-root? volatile?)
+                         (shared-network? shared-network?))))
          (os          (image-operating-system image))
          (target-file (match args
                         ((first second) second)
-- 
2.34.0





  parent reply	other threads:[~2021-12-16 13:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 13:02 [bug#52550] [PATCH 00/10] Further work on the image API Mathieu Othacehe
2021-12-16 13:06 ` [bug#52550] [PATCH 01/10] build: image: Add optional closure copy support Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 02/10] image: Add a shared-store? field Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 03/10] image: Add a shared-network? field Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 04/10] system: image: Add docker support Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 05/10] system: vm: Use the image API to generate QEMU images Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 06/10] Remove VM generation dead-code Mathieu Othacehe
2021-12-16 13:06   ` Mathieu Othacehe [this message]
2021-12-16 13:06   ` [bug#52550] [PATCH 08/10] scripts: system: Pass the volatile field to VM generation Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 09/10] scripts: system: Use the disk-image size argument for " Mathieu Othacehe
2021-12-16 13:06   ` [bug#52550] [PATCH 10/10] tests: docker: Fix it Mathieu Othacehe
2021-12-22 21:39 ` [bug#52550] [PATCH 00/10] Further work on the image API Ludovic Courtès
2021-12-23  9:57   ` bug#52550: " Mathieu Othacehe

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216130649.30285-7-othacehe@gnu.org \
    --to=othacehe@gnu.org \
    --cc=52550@debbugs.gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).