-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix delete a image while saving it, delete successfully but failed to…
… save it Issue Description: * 1. Saving more than one images, `docker save -o a.tar aaa bbb` * 2. Delete the last image which in saving progress. `docker rmi bbb` Espected: Saving images operation shouldn't be disturbed. But the real result is that failed to save image and get an error as below: `Error response from daemon: open /var/lib/docker/image/devicemapper/imagedb/content/sha256/7c24e4d533a76e801662ad1b7e6e06bc1204f80110b5623e96ba2877c51479a1: no such file or directory` Analysis: 1. While saving more than one images, it will get all the image info from reference/imagestore, and then using the `cached data` to save the images to a tar file. 2. But this process doesn't have a resource lock, if a deletion operation comes, the image will be deleted, so saving operation will fail. Solution: When begin to save an image, `Get` all the layers first. then the deletion operation won't delete the layers. Signed-off-by: Wentao Zhang <[email protected]>
- Loading branch information
Showing
1 changed file
with
67 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters