[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating a docker image with Guix
From: |
Christopher Allan Webber |
Subject: |
Re: Creating a docker image with Guix |
Date: |
Mon, 02 Jan 2017 20:28:57 -0600 |
User-agent: |
mu4e 0.9.16; emacs 25.1.1 |
Ricardo Wurmus writes:
> Hi Guix,
>
> I just played around with Docker and built up a command to create a
> Docker image for Emacs.
>
> Can anyone find a more elegant way to do this?
>
> --8<---------------cut here---------------start------------->8---
> guix environment --ad-hoc \
> coreutils bash emacs-no-x-toolkit -- \
> sh -c 'tar -c $(guix gc --requisites $GUIX_ENVIRONMENT) | \
> docker import -c "ONBUILD RUN [\"$GUIX_ENVIRONMENT/bin/ln\",
> \"-s\", \"$GUIX_ENVIRONMENT/bin\", \"/bin\"]" - emacs-base' \
> && echo -e "FROM emacs-base\nCMD [\"/bin/emacs\"]" | \
> docker build -
> --8<---------------cut here---------------end--------------->8---
>
> What happens here is this:
>
> * using “guix environment” build a temporary profile containing
> coreutils (for “ln”), bash (for “sh”), and emacs
>
> * inside the environment $GUIX_ENVIRONMENT points to the profile; take
> all of the requisites for this profile (“guix gc --requisites”) and
> send them to “docker import” using a tar pipe
>
> * modify the base image such that it links the profile’s “bin” directory
> to “/bin” when a derivative image is built
>
> * name that base image “emacs-base”
>
> * then build a derivative of this base image with “docker build” (this
> causes “ln -s” to be executed) and make it run the command
> “/bin/emacs” by default
>
> The result is an unnamed image (“docker build” reports an image id such
> as “ae8d6281b56f”) that can be run interactively like this:
>
> docker run -it --rm ae8d6281b56f
>
> What do you think? Gross?
>
> ~~ Ricardo
I won't comment on the specific application, but I think it's a good
thing to have. I was watching the conversation about providing an Emacs
Docker image on emacs-devel, and despite my caveats about Docker, I
think having Guix be a good way to get a "reproducible" image here is a
good idea. If nothing else, maybe it could become a good reason for
Docker-using people to explore Guix...
Thanks for exploring this, Ricardo!
- Chris
- Re: [PATCH] Creating a docker image with Guix, (continued)
- Re: [PATCH] Creating a docker image with Guix, Ludovic Courtès, 2017/01/04
- Re: [PATCH] Creating a docker image with Guix, Ricardo Wurmus, 2017/01/05
- Re: [PATCH] Creating a docker image with Guix, Thompson, David, 2017/01/05
- Re: [PATCH] Creating a docker image with Guix, Ludovic Courtès, 2017/01/05
- [PATCH] guix archive: '-f docker' supports package names as arguments., Ludovic Courtès, 2017/01/06
- Re: [PATCH] guix archive: '-f docker' supports package names as arguments., Ricardo Wurmus, 2017/01/07
- Re: [PATCH] guix archive: '-f docker' supports package names as arguments., Ludovic Courtès, 2017/01/08
Re: Creating a docker image with Guix,
Christopher Allan Webber <=
Re: Creating a docker image with Guix, Jan Nieuwenhuizen, 2017/01/03