Red Hat Bugzilla – Bug 1284869
atomic migrate export command doesn't support deleting dangling image
Last modified: 2016-03-31 19:25:21 EDT
Description of problem:
Atomic migrate command cann't deal with regular expressions, for example, for a dangling images, it will raise shell syntax error.
Version-Release number of selected component (if applicable):
# rpm -q docker atomic
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
Steps to Reproduce:
1. build a image to generate a dangling image
2. run atomic migrate export
# atomic images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
registry.access.redhat.com/openshift3/ose latest 2eb816e9a7d0 2015-11-12 05:29 395.32 MB
docker-registry.usersys.redhat.com/baude/oscapd latest 69871a5c7067 2015-10-29 07:38 909.87 MB
*<none> <none> 63b155fb8278 2015-10-27 16:13 1.11 MB
# atomic migrate export
Exporting image with id: 2eb816e9a7d0
Exporting image with id: 63b155fb8278
/bin/sh: -c: line 0: syntax error near unexpected token `>'
/bin/sh: -c: line 0: `docker save <none>:<none> > /var/lib/atomic/migrate/images/63b155fb8278.tar'
Fix it or doesn't support saving dangling image
I don't think we should save dangling images.
(In reply to Daniel Walsh from comment #1)
> I don't think we should save dangling images.
Yes, I think we have 2 ways to do this, the one is users must manually remove dangling images before migrating, and then it should be enough to document it in man page or help document; the other one is to let atomic migrate command more intelligent then can bypass or remove dangling images to do export, I tend to choose latter, it will be more convenient to migrate multiple docker containers own dangling images for users.
Perhaps the tool could either exit with an error if their are dangling images, or prompt the user to ask permission to delete the <none><none>
Shishir please comment.
There was already a check to ignore dangling images (<none>:<none>) from getting exported. Let me check why it is not working.
This is fixed in atomic master branch.
You need to tell the version
Fixed in atomic-1.9.
With atomic-1.8-4.git958d939.el7.x86_64, I can get a prompt information like this "There are dangling images in your system. Would you like atomic to prune them [y/N]" when migrating storage w/ dangling image, and it works well w/ 'y' and 'N' typing, so move the bug to VERIFIED status.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.