RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1186442 - docker load
Summary: docker load
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.1
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: smahajan@redhat.com
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1184247
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-27 16:45 UTC by Chris Evich
Modified: 2019-03-06 01:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-22 18:22:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chris Evich 2015-01-27 16:45:04 UTC
Description of problem:
When saving a repo, if you specify the image by ID, then the FQIN is discarded.  On load, the result is a '<none>' name '<none>' tag repo which isn't very user-friendly.  However, saving by FQIN does preserve the repo. name/tag, such that loading the tarball restores them.

Version-Release number of selected component (if applicable):
docker-1.3.2-9.el7.x86_64
and
docker-1.4.1-25.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. docker save -o <image name>.tar <image name>
2. docker save -o <image ID>.tar <image ID>
3. docker rmi <image name>
4. docker load -i <image ID>.tar
5. docker images
6. docker load -i <image name>.tar
7. docker images

Actual results:
[root@dockertest ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
docker_testimage    test_tag            9e4968c9710f        18 minutes ago      499.5 MB
[root@dockertest ~]# docker save -o docker_testimage:test_tag.tar docker_testimage:test_tag
[root@dockertest ~]# docker save -o 9e4968c9710f.tar 9e4968c9710f
[root@dockertest ~]# docker rmi docker_testimage:test_tag
Untagged: docker_testimage:test_tag
Deleted: 9e4968c9710f332e416307a1ac25cc80c5c2a85271234e38022ce300fa966c34
...cut...
Deleted: bef54b8f8a2fdd221734f1da404d4c0a7d07ee9169b1443a338ab54236c8c91a
[root@dockertest ~]# docker load -i 9e4968c9710f.tar
[root@dockertest ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
<none>              <none>              9e4968c9710f        23 minutes ago      499.5 MB
[root@dockertest ~]# docker load -i docker_testimage\:test_tag.tar 
[root@dockertest ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
docker_testimage    test_tag            9e4968c9710f        23 minutes ago      499.5 MB


Expected results:


[root@dockertest ~]# docker load -i 9e4968c9710f.tar
[root@dockertest ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
docker_testimage    test_tag            9e4968c9710f        23 minutes ago      499.5 MB
[root@dockertest ~]# docker load -i docker_testimage\:test_tag.tar 
[root@dockertest ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
docker_testimage    test_tag            9e4968c9710f        23 minutes ago      499.5 MB

Additional info:
In the case of saving by ID, all the FQIN's which point at that ID should be recorded.  On load, only the non-conflicting names should be restored, preferably issuing a warning about any name conflicts (bug 1184247).

Comment 1 Daniel Walsh 2015-01-27 16:51:03 UTC
Is this the case where docker would tell us to use docker export rather then docker save?

Comment 3 Chris Evich 2015-01-27 17:24:14 UTC
(In reply to Daniel Walsh from comment #1)
> Is this the case where docker would tell us to use docker export rather then
> docker save?

My understanding (could be wrong) based on --help output...

    Usage: docker export [OPTIONS] CONTAINER

    Export the contents of a filesystem as a tar archive to STDOUT

...is the export command is strictly for containers (not images/repositories).  Export only saves out the filesystem contents, none of the layers or other metadata (AFAIK).  However, docker 'load' and 'save' DO save parent layers and metadata (since saving by name restores the name and ID).

Also, I marked this 'LOW' since save/load do work (strictly speaking), so this is really mostly just a usability / automation problem.  I don't think a fix is urgently needed, just something "nice" if it worked.  Though I won't pretend to know all the use-cases affected :)

Comment 4 smahajan@redhat.com 2015-01-27 17:54:00 UTC
Chris, 

Follow the below logs;
http://pastebin.test.redhat.com/259282

Here I did `docker save docker-test-image` first using ID (img.tar) and then using image_name (img1.tar).

If you see the contents of img.tar it does not have the repositories JSON which is needed to generate the image name hence <none>:<none>

When you see the contents of img1.tar if has the required JSON so it generates the image name successfully.

If you think about it, it seems logical, since there can be multiple tags (names) to a single ID... saving an image with an ID and loading it back would confuse docker as which name to pick since the ID could translate to multiple names.

Hope that make sense :)

Comment 5 smahajan@redhat.com 2015-01-27 18:00:43 UTC
I can try to look at your proposal, of saving all the FQINs and see if a repositories JSON file can be generated (with all the FQINs) to enable `docker save using ID` not resulting in <none>:<none>

Comment 6 Chris Evich 2015-01-27 19:12:54 UTC
(In reply to smahajan from comment #4)
> If you see the contents of img.tar it does not have the repositories JSON
> which is needed to generate the image name hence <none>:<none>
> ...
> Hope that make sense :)

Yep, I suspected something like that.  So really, if it's dropping the entire JSON it's loosing much more data than just the FQIN.

> it seems logical...would confuse docker

Hrrrmmmm, nope, that doesn't make sense, people get confused, not programs :D

Seriously though, yes, the point is for a consistent user experience.  I marked this bug as depending on bug 1184247, since the load-name conflict warnings would also be really helpful.  Either way, I can imagine conflict-checking on load is non-trivial to write, and docker save does work in the strictest sense.  So a fix here isn't super urgent IMHO.

Thanks for taking a look.

Comment 7 smahajan@redhat.com 2015-01-27 19:24:15 UTC
> 
> Yep, I suspected something like that.  So really, if it's dropping the
> entire JSON it's loosing much more data than just the FQIN.

Actually the repositories JSON just has the image name, tag and hash.
>

Comment 8 smahajan@redhat.com 2015-02-05 16:32:45 UTC
Issue opened with docker.

https://github.com/docker/docker/issues/10592

Shishir

Comment 10 Daniel Walsh 2015-06-02 20:57:59 UTC
Could you ping docker on these pull requests to see if we have any update.

Comment 11 Daniel Walsh 2015-07-15 21:04:21 UTC
Shishir any update on this?

Comment 12 smahajan@redhat.com 2015-07-16 20:53:43 UTC
Hi Dan,

https://github.com/docker/docker/issues/10592

The community guy who asked to work on this, has got occupied on some contracting project. [See last 2 comments in the above issue].

I will take this over.

Shishir

Comment 13 Daniel Walsh 2015-07-17 13:00:19 UTC
ok

Comment 14 smahajan@redhat.com 2015-07-21 15:01:01 UTC
PR opened upstream.

https://github.com/docker/docker/pull/14809

Shishir

Comment 15 smahajan@redhat.com 2015-08-13 15:24:07 UTC
New PR for this one.
https://github.com/docker/docker/pull/15263

Shishir

Comment 16 Daniel Walsh 2015-09-28 18:29:46 UTC
Any update on this one?

Comment 17 smahajan@redhat.com 2015-10-19 17:54:32 UTC
Upstream (docker) is just completely unresponsive on this one.

Shishir

Comment 18 Daniel Walsh 2015-10-20 12:22:30 UTC
Well you got some response yesterday.

Comment 19 smahajan@redhat.com 2015-10-22 18:22:58 UTC
Closing this one, as upstream believe this is a feature not a bug.
According to docker:

Tags and Image IDs are two separate entities.
If you save an image using image ID, you should only get imageID and not tags.

docker save imageID > img.tar (This would not generate repositories JSON and only save the imageID)

docker load < img.tar would create an untagged (<none>:<none>) image. 

For more information, please check the comments in the PR:
https://github.com/docker/docker/pull/15263.


Note You need to log in before you can comment on or make changes to this bug.