Lagrange Point

Docker in Guix

Documentation is Guix is pretty good, I think, but still leaves a bit to be desired, so to that end, I will be featuring some blog posts about Guix for those who need it. First of all, lets go over what Docker is.

Docker is a method to use containers in Linux, and containers are basically micro operating systems usually used to run a single program in a hosting environment, although it can be used for so much more.

So, how do we get Docker in Guix?

First, in the (gnu services) line at the top of your system configuration Scheme file, make sure to put in “docker”. So for instance, if your line is (gnu services ssh xorg users), make it (gnu services ssh xorg users docker).

Next, in the services configuration, add the line(preferably in the middle of the services lines) (service docker-service-type). After having done that, do “sudo guix system reconfigure <YOURCONFIG>.scm”.

Done, you should Docker working now! Now, I won’t go into extra special use cases or anything of that nature, but yeah, for basic Docker service, doing the above should be fine.

Now, lets say you want to declaratively add a Docker service. Say, like an IRC server. First, make the above about Docker has been done, that you put it into your system config file and reconfigured. Lets get started with what you need to do after that.

OK then, here’s what we need to do. Again find the services line. Fill it in in first of all with this: (service oci-container-service-type

(list

(oci-container-configuran)

(user “oci-container”)
(group “docker”)
(image “inspircd/inspircd-docker”)
(provision “inspircd”)
(network “host”)
(ports
‘((“6667” . “6667” ))))))

Phew! That’s a lot! OK then, after having done that, do another “sudo guix system reconfigure <YOURCONFIG.scm” and Inspircd, a IRCd server, should be running on your local system, and you can login it by using a client such as weechat, irssi, ERC etc on “localhost” port 6667.

Next up, how to get Yggdrasil and Tailscale working in Guix!


Posted

in

by

Tags: