unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Build docker image
@ 2021-04-11  3:49 Bone Baboon
  2021-04-17 20:05 ` David Dashyan
  2021-04-19  3:48 ` Bone Baboon
  0 siblings, 2 replies; 6+ messages in thread
From: Bone Baboon @ 2021-04-11  3:49 UTC (permalink / raw)
  To: help-guix

I am trying to build a docker image.

I have added `docker` and `docker-cli` to my system configuration and
reconfigured the system.  The `docker` command needs a docker daemon
running.

I have added the docker service to the system configuration file with
`(service docker-service-type)` in the list of services.  When I try to
reconfigure the system I get this error message "guix system: error:
service 'dockerd' requires 'networking', which is not provided by any
service".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build docker image
  2021-04-11  3:49 Build docker image Bone Baboon
@ 2021-04-17 20:05 ` David Dashyan
  2021-04-19  3:27   ` Bone Baboon
  2021-04-19  3:48 ` Bone Baboon
  1 sibling, 1 reply; 6+ messages in thread
From: David Dashyan @ 2021-04-17 20:05 UTC (permalink / raw)
  To: Bone Baboon; +Cc: help-guix


Bone Baboon writes:

> I am trying to build a docker image.
>
> I have added `docker` and `docker-cli` to my system configuration and
> reconfigured the system.  The `docker` command needs a docker daemon
> running.
>
> I have added the docker service to the system configuration file with
> `(service docker-service-type)` in the list of services.  When I try to
> reconfigure the system I get this error message "guix system: error:
> service 'dockerd' requires 'networking', which is not provided by any
> service".

Hey Bone Baboon!

It is not 100% clear from your message how do you want to build a docker
image.  I'm assuming that you want to use standard docker tooling and
you want to have docker daemon on YOUR system.  Correct me I'm wrong
here.

Dockder service is one of the services that extends
shepherd-root-service-type.  They form dependency graph which is
different from extension graph you might have red in guix manual.  Each
shepherd service has "provision" field that defines list of simbols that
it provides and "requirement" field (defaulting to '()) that defines
which services it requeres to run.  Shepherd uses this information to
spawn services in right order.  But in your case procedure
assert-valid-graph (found in guix) warned you that graph is invalid
instead of producing shepherd configuration that will fail when you will
boot.

So. You need a service that provisionts 'networking!  You should
probably just use %desktop-services service list like so in your
config. It contains bunch of services you normaly need including
network-manager-service.

(operating-system
  ...
  (services
   (append
    (list
     ;; list of your services goes here
     (service xfce-desktop-service-type) ;; your wm of choice
     (service docker-service-type)) ;; docker daemon
    %desktop-services)))


> I have added `docker` and `docker-cli` to my system configuration and
> reconfigured the system.  The `docker` command needs a docker daemon
> running.
Note also that you dont need to add packages to system configuration to
use them.  You could just install it for your user profile.

But there are other ways to build docker images on guix like

guix system vm docker-image yourconf.scm

or

guix pack -f docker -S /bin=bin

Check out info manual for these comands in guix if you havent yet :)

-- 
David aka zzappie


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build docker image
  2021-04-17 20:05 ` David Dashyan
@ 2021-04-19  3:27   ` Bone Baboon
  2021-04-27 17:11     ` David Dashyan
  0 siblings, 1 reply; 6+ messages in thread
From: Bone Baboon @ 2021-04-19  3:27 UTC (permalink / raw)
  To: David Dashyan; +Cc: help-guix

David Dashyan writes:
> It is not 100% clear from your message how do you want to build a docker
> image.  I'm assuming that you want to use standard docker tooling and
> you want to have docker daemon on YOUR system.  Correct me I'm wrong
> here.

Yes that is correct `docker build -t <tag> .` with a local docker
daemon.

> Dockder service is one of the services that extends
> shepherd-root-service-type.  They form dependency graph which is
> different from extension graph you might have red in guix manual.  Each
> shepherd service has "provision" field that defines list of simbols that
> it provides and "requirement" field (defaulting to '()) that defines
> which services it requeres to run.  Shepherd uses this information to
> spawn services in right order.  But in your case procedure
> assert-valid-graph (found in guix) warned you that graph is invalid
> instead of producing shepherd configuration that will fail when you will
> boot.

This is a nice feature.

> So. You need a service that provisionts 'networking!

It seems odd that a service does not take care of services it needs.
It makes me think of a package that does not include the dependencies it
needs to run.

> You should probably just use %desktop-services service list like so in
> your config. It contains bunch of services you normaly need including
> network-manager-service.
>
> (operating-system
>   ...
>   (services
>    (append
>     (list
>      ;; list of your services goes here
>      (service xfce-desktop-service-type) ;; your wm of choice
>      (service docker-service-type)) ;; docker daemon
>     %desktop-services)))

Thank you for this suggestion.  There is a lot in %desktop-services that
I do not need on my system.  I am also trying to explicitly state
imports so that I can learn more about the parts of the Guix repository
I am using.

> Note also that you dont need to add packages to system configuration to
> use them.  You could just install it for your user profile.

Thank you for pointing this out.

> But there are other ways to build docker images on guix like
>
> guix system vm docker-image yourconf.scm
>
> or
>
> guix pack -f docker -S /bin=bin
>
> Check out info manual for these comands in guix if you havent yet :)

I am aware of these features and plan to explore them.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build docker image
  2021-04-11  3:49 Build docker image Bone Baboon
  2021-04-17 20:05 ` David Dashyan
@ 2021-04-19  3:48 ` Bone Baboon
  1 sibling, 0 replies; 6+ messages in thread
From: Bone Baboon @ 2021-04-19  3:48 UTC (permalink / raw)
  To: help-guix

I have got the dockerd service working.

I ran into many error messages along the way.

"guix system: error: service 'dockerd' requires 'networking', which is
not provided by any service"

This was solved with `dhpc-client-service-type`.

"guix system: error: service 'dockerd' requires 'dbus-system', which is
not provided by any service"

This was solved with `dbus-service`.

"guix system: error: service 'dockerd' requires 'elogind', which is not
provided by any service"

This was solved with `elogind-service-type`.

I made these additions to my system configuration to get the dockerd
service working.

I added these imports:
```
((gnu services dbus) #:select (dbus-service))
((gnu services desktop) #:select (elogind-service-type))
((gnu services docker) #:select (docker-service-type))
((gnu services networking) #:select (dhcp-client-service-type))
```
I added these to the services section of the operation system
declaration:
```
(service dhcp-client-service-type)
(dbus-service)
(service elogind-service-type)
(service docker-service-type)
```

Then I reconfigured the system.

`sudo herd start dockerd` was not working.  I restarted the computer and
dockerd was working.

Now `docker build -t <tag> .` is successful.

Bone Baboon writes:

> I am trying to build a docker image.
>
> I have added `docker` and `docker-cli` to my system configuration and
> reconfigured the system.  The `docker` command needs a docker daemon
> running.
>
> I have added the docker service to the system configuration file with
> `(service docker-service-type)` in the list of services.  When I try to
> reconfigure the system I get this error message "guix system: error:
> service 'dockerd' requires 'networking', which is not provided by any
> service".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build docker image
  2021-04-19  3:27   ` Bone Baboon
@ 2021-04-27 17:11     ` David Dashyan
  2021-04-27 17:16       ` David Dashyan
  0 siblings, 1 reply; 6+ messages in thread
From: David Dashyan @ 2021-04-27 17:11 UTC (permalink / raw)
  To: Bone Baboon; +Cc: help-guix


Hello Bone Baboon!

Great to hear that you got it working!

Bone Baboon writes:

> David Dashyan writes:
>> It is not 100% clear from your message how do you want to build a docker
>> image.  I'm assuming that you want to use standard docker tooling and
>> you want to have docker daemon on YOUR system.  Correct me I'm wrong
>> here.
>
> Yes that is correct `docker build -t <tag> .` with a local docker
> daemon.
>
>> Dockder service is one of the services that extends
>> shepherd-root-service-type.  They form dependency graph which is
>> different from extension graph you might have red in guix manual.  Each
>> shepherd service has "provision" field that defines list of simbols that
>> it provides and "requirement" field (defaulting to '()) that defines
>> which services it requeres to run.  Shepherd uses this information to
>> spawn services in right order.  But in your case procedure
>> assert-valid-graph (found in guix) warned you that graph is invalid
>> instead of producing shepherd configuration that will fail when you will
>> boot.
>
> This is a nice feature.
>
>> So. You need a service that provisionts 'networking!
>
> It seems odd that a service does not take care of services it needs.
> It makes me think of a package that does not include the dependencies it
> needs to run.

I'm not sure why it is done this way.  Perhaps because you could have
different service types providing same provision symbols?  And you as a
user/admin chose which to chose.  And also the dependency graph of guix
services enourmos as package dependency graph :)

-- 
David aka zzappie


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Build docker image
  2021-04-27 17:11     ` David Dashyan
@ 2021-04-27 17:16       ` David Dashyan
  0 siblings, 0 replies; 6+ messages in thread
From: David Dashyan @ 2021-04-27 17:16 UTC (permalink / raw)
  To: Bone Baboon; +Cc: help-guix



Agr typos... need to make habit running ispell all the time...

...
I'm not sure why it is done this way.  Perhaps because you could have
different service types providing same provision symbols?  And you as a
user/admin CHOOSE which to CHOOSE.  And also the dependency graph of guix
services NOT AS ENORMOUS as package dependency graph :)
...

-- 
David aka zzappie


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-27 17:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-11  3:49 Build docker image Bone Baboon
2021-04-17 20:05 ` David Dashyan
2021-04-19  3:27   ` Bone Baboon
2021-04-27 17:11     ` David Dashyan
2021-04-27 17:16       ` David Dashyan
2021-04-19  3:48 ` Bone Baboon

unofficial mirror of help-guix@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git