On 5/30/25 09:10, poplin wrote:
> So far my working approach was to define a simple service that runs a
> "built" container using make-forkexec-constructor (in a simple
> service).  But this solution lacks to have the built phase controlled by
> shepherd (something equivalent of what is achieved with docker-pull). 
> So I need to manually update the container (if I change its definition
> or after a "guix pull" is done in the host) which is not (at all) ideal. 
> 
> The host service is defined as:
> 
>       (simple-service
>        'cont-service shepherd-root-service-type
>        (list
>         (shepherd-service
>          (auto-start? #t)
>          (documentation "Runs containeraized service")
>          (provision '(cont-service))
>          (requirement '(user-processes))
>          (respawn? #t)
>          (start
>           #~(make-forkexec-constructor
>              '("/path/cont-service-user")))
>          (stop #~(make-kill-destructor))))))
> 
> 
> And to build the container I use:
> 
> $ guix system container --network --share=/path/service_shared_folder=/
> path/shared --root=/path/cont-service-user /path/cont-service.scm

Thanks for sharing the example.

> (To control the build of the container by shepherd I've tried to include
> the last command by defining actions/procedure in the shepherd service
> definition, or by running a bash script in make-forkexec-constructor
> which contains the guix system container command but I did not manage to
> get any positive outcome). 
> 
> Any comment?

You could post what you tried here if you want to. I doubt I would know
how to make it work (I'm new to both Guix and Guile), but someone else
might have some feedback.

> Have you had any progress on your side.?

Unfortunately I don't have anything to add currently. I may revisit this
later, perhaps with an operating-system definition in oci-image with
Podman (not as nice as guix system container, but similar) if these
patches get merged: <https://issues.guix.gnu.org/76081>.

Sorry I can't help more.

Naranden

Reply via email to