[PATCH] Creating a docker image with Guix

From:

Ricardo Wurmus

Subject:

[PATCH] Creating a docker image with Guix

Date:

Tue, 3 Jan 2017 16:34:33 +0100

User-agent:

mu4e 0.9.16; emacs 25.1.1

Ludovic Courtès <address@hidden> writes:
> I’m not familiar enough with Docker but I’m under the impression that we
> should be able to generate an image without even using Docker. :-)
The attached patch adds a Docker export feature, so you can do this:
docker load < \
$(guix archive --export-docker-image=$(readlink -f ~/.guix-profile))
Then you can use “docker images” to show the available images. For some
reason Docker won’t show the name and tag “guix archive” generates, so
just take the most recently added image. Then run it, e.g. like this:
docker run --rm -ti d11111472905 /bin/emacs
This starts the container and runs “/bin/emacs” interactively. During
export “guix archive” also links the item’s “./bin” directory to “/bin”,
so users can run commands without having to know the long store path.
I used it successfully to build an Emacs Docker image like this:
guix environment --ad-hoc coreutils bash emacs-no-x-toolkit
docker load < $(guix archive --export-docker-image=$GUIX_ENVIRONMENT)
~~ Ricardo