Due to current deficiencies in the Windows implementation of
containerd's Mount.Mount, we need different behaviour for mounting on
Windows and Unix platforms.
Specifically:
* Windows mounts can only mount in-place, and hence only one mount
should be in the list.
* BuildKit doesn't own the mount directory, so should not try and remove
it on unmount.
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
Refactor the interface to avoid such issues in the future.
BuildKit own mounts are stateless and not affected but
a different mountable implementation could get confused.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Replaces previous mutable.Freeze logic with
commits that can live together with mutable data.
Finalize method is added if the implementation
needs to make sure that the immutable ref is
flushed to the driver. Refs are automaitcally
finalized when writable layers are created on
top of them.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>