GNU bug report logs -
#61627
Cannot start a container built with `guix system container --network'.
Previous Next
Full log
View this message in rfc822 format
Hi,
On 2023-02-19 15:29, Pierre Langlois wrote:
>
> Pierre Langlois <pierre.langlois <at> gmx.com> writes:
>
> Digging into the container script code, I think the reason is that when
> sharing the network, it's supposed to remove any network-related
> services from the containerized operating system. And it's not aware of
> the new hosts-service-type. The following diff seems to fix the issue:
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
> index c2fd55d48e..9190d013bc 100644
> --- a/gnu/system/linux-container.scm
> +++ b/gnu/system/linux-container.scm
> @@ -49,9 +49,12 @@ (define* (container-essential-services os #:key shared-network?)
> (define base
> (remove (lambda (service)
> (memq (service-kind service)
> - (list (service-kind %linux-bare-metal-service)
> - firmware-service-type
> - system-service-type)))
> + (cons* (service-kind %linux-bare-metal-service)
> + firmware-service-type
> + system-service-type
> + (if shared-network?
> + (list hosts-service-type)
> + '()))))
> (operating-system-default-essential-services os)))
>
> (cons (service system-service-type
> --8<---------------cut here---------------end--------------->8---
>
> I wonder if this is a full fix though, I see that we also remove network
> related configuration files, using `%network-configuration-files', and I
> wonder if "/etc/hosts" is still supposed to be there?
>
> --8<---------------cut here---------------start------------->8---
> (define %network-configuration-files
> ;; List of essential network configuration files.
> '("/etc/resolv.conf"
> "/etc/nsswitch.conf"
> "/etc/services"
> "/etc/hosts"))
> --8<---------------cut here---------------end--------------->8---
/etc/hosts is created by hosts-service-type, so if you remove that service
it shouldn't be present anymore.
Cheers,
Bruno
This bug report was last modified 2 years and 112 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.