From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggsout.gnu.org ([209.51.188.92]:36853 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggF5b-0001nQ-45 for guix-patches@gnu.org; Sun, 06 Jan 2019 15:32:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggF5W-0000wu-M7 for guix-patches@gnu.org; Sun, 06 Jan 2019 15:32:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:46185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggF5W-0000wL-Gl for guix-patches@gnu.org; Sun, 06 Jan 2019 15:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggF5W-0006ZA-4P for guix-patches@gnu.org; Sun, 06 Jan 2019 15:32:02 -0500 Subject: [bug#33893] [PATCH v5 3/4] services: Add docker. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20181230121754.775-1-dannym@scratchpost.org> <20181230233903.23426-1-dannym@scratchpost.org> <20181230233903.23426-4-dannym@scratchpost.org> Date: Sun, 06 Jan 2019 21:31:00 +0100 In-Reply-To: <20181230233903.23426-4-dannym@scratchpost.org> (Danny Milosavljevic's message of "Mon, 31 Dec 2018 00:39:02 +0100") Message-ID: <87ftu5y1dn.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 33893@debbugs.gnu.org Danny Milosavljevic skribis: > * gnu/services/docker.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. > * doc/guix.texi (Miscellaneous Services): Document the service. Nice! > +@cindex docker =E2=80=9CDocker=E2=80=9D with a capital. > +@subsubheading Docker Service > + > +The @code{(gnu services docker)} module provides the following service. > + > +@defvr {Scheme Variable} docker-service-type > + > +This is a service that runs @url{http://www.docker.com,Docker}, a daemon= that > +provides container functionality. > + We=E2=80=99re missing =E2=80=9C@end defvr=E2=80=9D I guess. I think we shouldn=E2=80=99t propagate the narrative that Docker =3D contai= ner. So what about something like: This is the type of the service that runs @url{=E2=80=A6, Docker}, a daem= on that can execute application bundles (sometimes referred to as ``containers'') in isolated environments. ? Also could you document =E2=80=98docker-configuration=E2=80=99 as well? [...] > +;; TODO: Refactor out into its own module? How to depend on it then? > +(define (containerd-shepherd-service config) > + (let* ((package (docker-configuration-containerd config))) > + (shepherd-service > + (documentation "containerd daemon.") > + (provision '(containerd)) > + (start #~(make-forkexec-constructor > + (list (string-append #$package "/bin/containerd")))) > + (stop #~(make-kill-destructor))))) I suppose there could be a separate =E2=80=98containerd-service-type=E2=80= =99 if it=E2=80=99s useful; if it=E2=80=99s not, it=E2=80=99s OK to keep it this way. As for the dependency, users would have to add both docker and containerd to their service list, or docker-service-type could extend containerd-service-type, which would ensure containerd-service-type is automatically instantiated if it=E2=80=99s not already in the user=E2=80=99= s service list. > +(define docker-service-type > + (service-type (name 'docker) > + (extensions > + (list > + (service-extension activation-service-type > + %docker-activation) > + (service-extension shepherd-root-service-type > + (lambda args > + (list (apply containerd-shepherd-= service args) > + (apply docker-shepherd-serv= ice args)))) You can make the above (lambda (config) =E2=80=A6) instead of (lambda (args= ) =E2=80=A6). > + (service-extension account-service-type > + (const %docker-accounts)))) > + (default-value (docker-configuration)))) Please add a =E2=80=98description=E2=80=99 field here, and please remove ta= bs from the file. :-) Could you consider adding a system test for docker/containerd? Perhaps we could go as far as using =E2=80=98docker-image=E2=80=99 in (guix scripts= pack) to generate an image and make sure =E2=80=98docker load=E2=80=99 works, but ma= ybe that=E2=80=99s too much work. Thank you, Ludo=E2=80=99.