unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Docker image: from profile/manifest to manifest.scm?
@ 2020-09-23  2:07 zimoun
  2020-09-23  8:32 ` Pierre Neidhardt
  2020-09-24 17:26 ` zimoun
  0 siblings, 2 replies; 3+ messages in thread
From: zimoun @ 2020-09-23  2:07 UTC (permalink / raw)
  To: Guix Devel

Dear,

Sometimes ago, we discussed at length the consistency between
profile/manifest and the manifest.scm files.  And the conclusion –if I
remember correctly– was to have somehow a converter; Pierre proposed a
draft.

The command

  guix pack -f docker --save-provenance -m manifest.scm
  
builds the Docker image which can be directly loaded via “docker load”
and even pushed to Docker Hub (say with the tag “foo/bar”).  Then this
very image can be pulled with “docker pull foo/bar”.

Usually, the Docker images are big blobs and hard (nor impossible) to
reproduce with the Dockerfile.  However, the ones produced by Guix can
be reproduced later, even if the final user has only the opaque Docker
image.  Thanks to the option “–save-provenance”.

Well, I do not know to find the profile path with the Docker tools.
Does someone have a tip?

Let the image contains BusyBox, so:

   docker run -ti b0766a6f8a18 which emacs

says the profile is “gnu/store/…-profile”.  And note:

--8<---------------cut here---------------start------------->8---
$ guix gc -D $(docker run -ti b0766a6f8a18 which emacs)
finding garbage collector roots...
deleting `/gnu/store/trash'
deleting unused links...
note: currently hard linking saves 19558.10 MiB
--8<---------------cut here---------------end--------------->8---

The “profile/manifest“ is therefore available with:

--8<---------------cut here---------------start------------->8---
$ docker run -ti b0766a6f8a18 cat /gnu/store/d18kjh1922ya9xnmz6k3nnlqz71kzqr4-profile/manifest | head -n30
;; This file was automatically generated and is for internal use only.
;; It cannot be passed to the '--manifest' option.

(manifest
  (version 3)
  (packages
    (("busybox"
      "1.31.1"
      "out"
      "/gnu/store/sz2k7vazy8dmsi1l6zw8ipx2bpwcwq3c-busybox-1.31.1"
      (propagated-inputs ())
      (search-paths ())
      (properties
        (provenance
          (repository
            (version 0)
            (url "https://git.savannah.gnu.org/git/guix.git")
            (branch "master")
            (commit
              "4a2cb3fa0e6384d7ad9f4cc7ca1fb46f63ebdb41")
            (introduction
              (channel-introduction
                (version 0)
                (commit
                  "9edb3f66fd807b096b48283debdcddccfea34bad")
                (signer
                  "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))))
     ("sassc"
      "3.6.1"
      "out"
[..]      
--8<---------------cut here---------------end--------------->8---


The 2 questions are:

 1. How can I find this /gnu/store/…-profile/manifest file with only the
 Docker tools?

 2. What is the status of the converter from profile/manifest to
 manifest.scm discussed sometimes ago?


Thank you in advance.

All the best,
simon






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

* Re: Docker image: from profile/manifest to manifest.scm?
  2020-09-23  2:07 Docker image: from profile/manifest to manifest.scm? zimoun
@ 2020-09-23  8:32 ` Pierre Neidhardt
  2020-09-24 17:26 ` zimoun
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre Neidhardt @ 2020-09-23  8:32 UTC (permalink / raw)
  To: zimoun, Guix Devel

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

Hi Simon!

zimoun <zimon.toutoune@gmail.com> writes:

>  2. What is the status of the converter from profile/manifest to
>  manifest.scm discussed sometimes ago?

I haven't heard of any change ever since we discussed it, sorry :p

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

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

* Re: Docker image: from profile/manifest to manifest.scm?
  2020-09-23  2:07 Docker image: from profile/manifest to manifest.scm? zimoun
  2020-09-23  8:32 ` Pierre Neidhardt
@ 2020-09-24 17:26 ` zimoun
  1 sibling, 0 replies; 3+ messages in thread
From: zimoun @ 2020-09-24 17:26 UTC (permalink / raw)
  To: Guix Devel

Dear,

On Wed, 23 Sep 2020 at 04:07, zimoun <zimon.toutoune@gmail.com> wrote:

> The 2 questions are:
>
>  1. How can I find this /gnu/store/…-profile/manifest file with only the
>  Docker tools?

I have found an answer to my question. :-)  Well, using “docker export”.

--8<---------------cut here---------------start------------->8---
  docker load < $(guix time-machine -C channels.scm \
                    -- pack -f docker \
                       -m manifest.scm --save-provenance)
  
  docker run -ti <TAG>
  docker ps -a
  
  docker export -o foo.tar <ID>
  
  tar -xf foo.tar $(tar -tf foo.tar | grep ’profile/manifest’)
  cat gnu/store/…-profile/manifest
--8<---------------cut here---------------end--------------->8---

Is it possible to automatize these steps?


>  2. What is the status of the converter from profile/manifest to
>  manifest.scm discussed sometimes ago?

Well, the converter extracting an approximation to the manifest.scm and
channels.scm files should be really could to have.


All the best,
simon


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

end of thread, other threads:[~2020-09-24 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23  2:07 Docker image: from profile/manifest to manifest.scm? zimoun
2020-09-23  8:32 ` Pierre Neidhardt
2020-09-24 17:26 ` zimoun

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).