The following sequence of operations happen while creating/removing an image layer.
Creating an image layer:
Create a layer, populate with data.
Update bunch of files in /var/lib/docker about the new image (the last one is repositories.json).
Removing an image layer:
Update a bunch of files in /var/lib/docker (which also replaces repositories.json with new data).
Remove the layer corresponding to the image being deleted.
If the system crashes after step 1 during the above operations, there will be an orphaned image in the graphdriver. Need a utilitly to clean up such orphaned layers.
The following sequence of operations happen while creating/removing an image layer.
If the system crashes after step 1 during the above operations, there will be an orphaned image in the graphdriver. Need a utilitly to clean up such orphaned layers.
See https://github.com/portworx/lcfs/issues/14 on how Docker keeps track of layers.