unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* guix pack -f docker and name ?
@ 2019-05-16 18:47 zimoun
  2019-05-20 15:42 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: zimoun @ 2019-05-16 18:47 UTC (permalink / raw)
  To: Guix Devel

Dear,

I find a bit annoying 2 things when creating Docker images with `guix pack`.

1.
The name of the tar is given at the end of the command `guix pack`. If
you forget to track it, then you need to re-run `guix pack` (obviously
with the very same parameters) to get it again.
It is not super user-friendly. :-)

What to think to add an option to name a symbolic link to this file in
the store ?

Currently, I am doing that by hand:
  guix pack -f docker ...
  # copy the name /gnu/store/<hash>-docker-pack.tar
  ln -s paste my-name

In general, I choose my-name as <foo-bar>-<hash> with <foo-bar>
something to quickly remember what it is and the <hash> to be sure of
what it is.

2.
Once loaded with `docker load < /gnu/store/<hash>-docker-pack.tar`
then `docker image ls` list all the images. The REPOSITORY and TAG are
not super helpful. :-)
It is always: profile and <hash>.

Maybe REPOSITORY should be guix and TAG should be <short-hash>-<name>.
Because when one has more than 2 images, after holidays it is not
possible to remember or they needs to track in a separate file what it
is.


Maybe I am missing something. Please correct me if there is way. Or
comment if you have suggestion.


All the best,
simon

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

* Re: guix pack -f docker and name ?
  2019-05-16 18:47 guix pack -f docker and name ? zimoun
@ 2019-05-20 15:42 ` Ludovic Courtès
  2019-05-20 19:34   ` zimoun
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2019-05-20 15:42 UTC (permalink / raw)
  To: zimoun; +Cc: Guix Devel

Hi Simon,

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

> 1.
> The name of the tar is given at the end of the command `guix pack`. If
> you forget to track it, then you need to re-run `guix pack` (obviously
> with the very same parameters) to get it again.
> It is not super user-friendly. :-)
>
> What to think to add an option to name a symbolic link to this file in
> the store ?
>
> Currently, I am doing that by hand:
>   guix pack -f docker ...
>   # copy the name /gnu/store/<hash>-docker-pack.tar
>   ln -s paste my-name
>
> In general, I choose my-name as <foo-bar>-<hash> with <foo-bar>
> something to quickly remember what it is and the <hash> to be sure of
> what it is.

I think ‘guix pack’ should have a ‘-r/--root’ option like ‘guix build’
so you can do:

  guix pack -r my-image -f docker foo bar baz

WDYT?

> 2.
> Once loaded with `docker load < /gnu/store/<hash>-docker-pack.tar`
> then `docker image ls` list all the images. The REPOSITORY and TAG are
> not super helpful. :-)
> It is always: profile and <hash>.
>
> Maybe REPOSITORY should be guix and TAG should be <short-hash>-<name>.
> Because when one has more than 2 images, after holidays it is not
> possible to remember or they needs to track in a separate file what it
> is.

I agree, we can do better here.  :-)

We could allow for user-provided names, and/or, when ‘--save-provenance’
is used, we could show the commit ID or something.

Ideas?

You’ve already proposed other improvements to ‘guix pack -f’, and I
think you should email a concise reminder to each specific improvement
to bug-guix so we keep track of them.  I may be able to work on them
soonish.

Thank you!

Ludo’.

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

* Re: guix pack -f docker and name ?
  2019-05-20 15:42 ` Ludovic Courtès
@ 2019-05-20 19:34   ` zimoun
  2019-05-20 20:02     ` Ricardo Wurmus
  2019-05-21  8:52     ` Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: zimoun @ 2019-05-20 19:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix Devel

Hi ludo,

On Mon, 20 May 2019 at 17:42, Ludovic Courtès <ludo@gnu.org> wrote:
>
> Hi Simon,
>
> zimoun <zimon.toutoune@gmail.com> skribis:
>
> > 1.
> > The name of the tar is given at the end of the command `guix pack`. If
> > you forget to track it, then you need to re-run `guix pack` (obviously
> > with the very same parameters) to get it again.
> > It is not super user-friendly. :-)
> >
> > What to think to add an option to name a symbolic link to this file in
> > the store ?
> >
> > Currently, I am doing that by hand:
> >   guix pack -f docker ...
> >   # copy the name /gnu/store/<hash>-docker-pack.tar
> >   ln -s paste my-name
> >
> > In general, I choose my-name as <foo-bar>-<hash> with <foo-bar>
> > something to quickly remember what it is and the <hash> to be sure of
> > what it is.
>
> I think ‘guix pack’ should have a ‘-r/--root’ option like ‘guix build’
> so you can do:
>
>   guix pack -r my-image -f docker foo bar baz
>
> WDYT?

Yes, it better fits what I am more or less doing by hand.
Nice `guix pack` owns this option.

>
> > 2.
> > Once loaded with `docker load < /gnu/store/<hash>-docker-pack.tar`
> > then `docker image ls` list all the images. The REPOSITORY and TAG are
> > not super helpful. :-)
> > It is always: profile and <hash>.
> >
> > Maybe REPOSITORY should be guix and TAG should be <short-hash>-<name>.
> > Because when one has more than 2 images, after holidays it is not
> > possible to remember or they needs to track in a separate file what it
> > is.
>
> I agree, we can do better here.  :-)
>
> We could allow for user-provided names, and/or, when ‘--save-provenance’
> is used, we could show the commit ID or something.
>
> Ideas?

I was proposing:
 guix pack -f docker -r foo
generates the file:
/gnu/store/<long-hash>-docker-pack.tar
where the symlink foo to this file and the field REPOSITORY should be
guix and the field TAG should `foo-<short-hash>` where <short-hash>`
is let say 6 characters.

I do not know if it is the right way. What do people using Docker think ?


> You’ve already proposed other improvements to ‘guix pack -f’, and I
> think you should email a concise reminder to each specific improvement
> to bug-guix so we keep track of them.  I may be able to work on them
> soonish.

Ok.
You mean one "ticket" by minor "feature"?
Or one "ticket" collecting all the minor improvements (items)?

All the best,
simon

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

* Re: guix pack -f docker and name ?
  2019-05-20 19:34   ` zimoun
@ 2019-05-20 20:02     ` Ricardo Wurmus
  2019-05-21  8:52     ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ricardo Wurmus @ 2019-05-20 20:02 UTC (permalink / raw)
  To: zimoun; +Cc: guix-devel


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

>> You’ve already proposed other improvements to ‘guix pack -f’, and I
>> think you should email a concise reminder to each specific improvement
>> to bug-guix so we keep track of them.  I may be able to work on them
>> soonish.
>
> Ok.
> You mean one "ticket" by minor "feature"?
> Or one "ticket" collecting all the minor improvements (items)?

Let’s have one bug per independent feature.  It’s very motivating to be
able to implement a small feature and close its associated bug report —
much more so than to bite off a small piece of a large report that you
don’t get to close afterwards :)

-- 
Ricardo

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

* Re: guix pack -f docker and name ?
  2019-05-20 19:34   ` zimoun
  2019-05-20 20:02     ` Ricardo Wurmus
@ 2019-05-21  8:52     ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2019-05-21  8:52 UTC (permalink / raw)
  To: zimoun; +Cc: Guix Devel

Howdy!

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

> On Mon, 20 May 2019 at 17:42, Ludovic Courtès <ludo@gnu.org> wrote:

[...]

>> I think ‘guix pack’ should have a ‘-r/--root’ option like ‘guix build’
>> so you can do:
>>
>>   guix pack -r my-image -f docker foo bar baz
>>
>> WDYT?
>
> Yes, it better fits what I am more or less doing by hand.
> Nice `guix pack` owns this option.

Cool.  Note that the advantage is the GC root, but if it’s just about
creating a symlink, you can also do:

  ln -s $(guix pack -f docker whatever) my-symlink

>> > 2.
>> > Once loaded with `docker load < /gnu/store/<hash>-docker-pack.tar`
>> > then `docker image ls` list all the images. The REPOSITORY and TAG are
>> > not super helpful. :-)
>> > It is always: profile and <hash>.
>> >
>> > Maybe REPOSITORY should be guix and TAG should be <short-hash>-<name>.
>> > Because when one has more than 2 images, after holidays it is not
>> > possible to remember or they needs to track in a separate file what it
>> > is.
>>
>> I agree, we can do better here.  :-)
>>
>> We could allow for user-provided names, and/or, when ‘--save-provenance’
>> is used, we could show the commit ID or something.
>>
>> Ideas?
>
> I was proposing:
>  guix pack -f docker -r foo
> generates the file:
> /gnu/store/<long-hash>-docker-pack.tar
> where the symlink foo to this file and the field REPOSITORY should be
> guix and the field TAG should `foo-<short-hash>` where <short-hash>`
> is let say 6 characters.

OK.

> I do not know if it is the right way. What do people using Docker think ?

Yup, I’m curious what people think best practice is!  Because I don’t
really qualify as a “Docker user” myself.  :-)

Thank you,
Ludo’.

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

end of thread, other threads:[~2019-05-21  8:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 18:47 guix pack -f docker and name ? zimoun
2019-05-20 15:42 ` Ludovic Courtès
2019-05-20 19:34   ` zimoun
2019-05-20 20:02     ` Ricardo Wurmus
2019-05-21  8:52     ` Ludovic Courtès

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).