bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61627: Cannot start a container built with `guix system container --


From: Bruno Victal
Subject: bug#61627: Cannot start a container built with `guix system container --network'.
Date: Mon, 20 Mar 2023 17:46:23 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

Hi,


On 2023-02-19 15:29, Pierre Langlois wrote:
> 
> Pierre Langlois <pierre.langlois@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]