From 5a84f77819543dd45f15a6984325d9b0d73c1dc9 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Tue, 22 Nov 2016 11:21:34 -0800 Subject: [PATCH] plugins: container-rootfs-relative paths Legacy plugins expect host-relative paths (such as for Volume.Mount). However, a containerized plugin cannot respond with a host-relative path. Therefore, this commit modifies new volume plugins' paths in Mount and List to prepend the container's rootfs path. This introduces a new PropagatedMount field in the Plugin Config. When it is set for volume plugins, RootfsPropagation is set to rshared and the path specified by PropagatedMount is bind-mounted with rshared prior to launching the container. This is so that the daemon code can access the paths returned by the plugin from the host mount namespace. Signed-off-by: Tibor Vass --- docs/extend/config.md | 4 ++++ docs/extend/plugins_volume.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/extend/config.md b/docs/extend/config.md index 221150a07b..e068eaccfa 100644 --- a/docs/extend/config.md +++ b/docs/extend/config.md @@ -111,6 +111,10 @@ Config provides the base accessible fields for working with V0 plugin format options of the mount. +- **`propagatedMount`** *string* + + path to be mounted as rshared, so that mounts under that path are visible to docker. This is useful for volume plugins. + - **`env`** *PluginEnv array* env of the plugin, struct consisting of the following fields diff --git a/docs/extend/plugins_volume.md b/docs/extend/plugins_volume.md index b123543f6f..c060bf39b1 100644 --- a/docs/extend/plugins_volume.md +++ b/docs/extend/plugins_volume.md @@ -22,6 +22,10 @@ beyond the lifetime of a single Engine host. See the ## Changelog +### 1.13.0 + +- If used as part of the v2 plugin architecture, mountpoints that are part of paths returned by plugin have to be mounted under the directory specified by PropagatedMount in the plugin configuration [#26398](https://github.com/docker/docker/pull/26398) + ### 1.12.0 - Add `Status` field to `VolumeDriver.Get` response ([#21006](https://github.com/docker/docker/pull/21006#))