This fixes a bug in the interaction between volumes in base images (#555)

and our snapshot optimizations.

If a previous base image has a volume, the directory is added to the
list of files to snapshot. That directory may not actually exist in the image.
This commit is contained in:
dlorenc
2019-02-08 14:40:37 -06:00
committed by GitHub
parent e14b660947
commit 9047ccf7cc
4 changed files with 19 additions and 14 deletions
+2 -5
View File
@@ -285,11 +285,8 @@ func (s *stageBuilder) takeSnapshot(files []string) (string, error) {
if files == nil || s.opts.SingleSnapshot {
snapshot, err = s.snapshotter.TakeSnapshotFS()
} else {
// Volumes are very weird. They get created in their command, but snapshotted in the next one.
// Add them to the list of files to snapshot.
for v := range s.cf.Config.Volumes {
files = append(files, v)
}
// Volumes are very weird. They get snapshotted in the next command.
files = append(files, util.Volumes()...)
snapshot, err = s.snapshotter.TakeSnapshot(files)
}
timing.DefaultRun.Stop(t)