help-guix
[Top][All Lists]
Advanced

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

Re: Relationship between Docker and Guix


From: zimoun
Subject: Re: Relationship between Docker and Guix
Date: Mon, 25 Nov 2019 16:52:59 +0100

Hi,

Thank you Ricardo for the detailed explanations.


I do not know if my analogy below is correct and/or useful.

The relationship between Docker and GNU Guix is container and the LXC
[1] technology. They use both but differently:

 - Docker is rooted in mutable/imperative and tries to go to more functional;
 - Guix is rooted in immutable/functional.


Everything starts with a configuration file: Dockerfile versus manifest.scm.

 - Dockerfile depends on the state of the distribution that one will
use -- say Debian -- and each time "RUN apt-get update" and/or "RUN
apt-get install" is called then no one can know in advance what the
resulting disk image will *exactly* contain;
 - the manifest.scm depends on the state of the channel trees, other
said, on commit hashes -- manifest.scm acts as a pure function: same
inputs, same outputs -- so one obtain exactly the same container.

We cannot guarantee that the manifest.scm file which one runs today
will generate the same bit-to-bit disk image in the future. Mainly
because it has not been tested yet on the long run. :-)

However, Guix provides the tools to detect that something is not as
expected. For example, we can imagine that today one says: this is the
manifest to build the disk image and the hashes of the store are that
(the same way one provides the MD5 of files when downloading); then in
the future, building again the disk image, we can compare. Currently,
it is impossible with Docker because all the distro are doomed
(mutable). ;-) So what people are currently doing is to store all the
Docker disk images.

Docker motto: build once and run anywhere.
Guix motto(*): build anytime and run everywhere.


To me the relationship(**) is:

   guix pack -f docker -m stuff.scm
   docker load < /gnu/store/<hash>-fancy-name.tar
   docker push



Hope that helps.

All the best,
simon



[1] https://en.wikipedia.org/wiki/LXC

(*) it is not official and my personal view ;-)
(**) again my personal view.



reply via email to

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