From d6c43d7bc1543f22bb850a2bad529bf3d60789ad Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 7 May 2020 12:35:35 +0200 Subject: guix system: 'docker-image' honors '--network'. * gnu/system/vm.scm (system-docker-image): Add #:shared-network? and pass it to 'containerized-operating-system'. (qemu-image): * guix/scripts/system.scm (system-derivation-for-action): Pass #:shared-network? to 'system-docker-image'. * doc/guix.texi (Invoking guix system): Document it. --- gnu/system/vm.scm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'gnu') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 1cab8997b4..2e82e12be2 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -419,13 +419,17 @@ system." (define* (system-docker-image os #:key (name "guix-docker-image") - (register-closures? (has-guix-service-type? os))) + (register-closures? (has-guix-service-type? os)) + shared-network?) "Build a docker image. OS is the desired . NAME is the -base name to use for the output file. When REGISTER-CLOSURES? is true, -register the closure of OS with Guix in the resulting Docker image. By -default, REGISTER-CLOSURES? is set to true only if a service of type -GUIX-SERVICE-TYPE is present in the services definition of the operating -system." +base name to use for the output file. When SHARED-NETWORK? is true, assume +that the container will share network with the host and thus doesn't need a +DHCP client, nscd, and so on. + +When REGISTER-CLOSURES? is true, register the closure of OS with Guix in the +resulting Docker image. By default, REGISTER-CLOSURES? is set to true only if +a service of type GUIX-SERVICE-TYPE is present in the services definition of +the operating system." (define schema (and register-closures? (local-file (search-path %load-path @@ -442,7 +446,9 @@ system." (let ((os (operating-system-with-gc-roots - (containerized-operating-system os '()) + (containerized-operating-system os '() + #:shared-network? + shared-network?) (list boot-program))) (name (string-append name ".tar.gz")) (graph "system-graph")) -- cgit v1.2.3