|
@@ -24,6 +24,7 @@ import (
|
|
"github.com/docker/docker/distribution"
|
|
"github.com/docker/docker/distribution"
|
|
progressutils "github.com/docker/docker/distribution/utils"
|
|
progressutils "github.com/docker/docker/distribution/utils"
|
|
"github.com/docker/docker/distribution/xfer"
|
|
"github.com/docker/docker/distribution/xfer"
|
|
|
|
+ "github.com/docker/docker/dockerversion"
|
|
"github.com/docker/docker/image"
|
|
"github.com/docker/docker/image"
|
|
"github.com/docker/docker/layer"
|
|
"github.com/docker/docker/layer"
|
|
"github.com/docker/docker/pkg/chrootarchive"
|
|
"github.com/docker/docker/pkg/chrootarchive"
|
|
@@ -150,6 +151,20 @@ func computePrivileges(c types.PluginConfig) (types.PluginPrivileges, error) {
|
|
Value: []string{c.Network.Type},
|
|
Value: []string{c.Network.Type},
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ if c.IpcHost {
|
|
|
|
+ privileges = append(privileges, types.PluginPrivilege{
|
|
|
|
+ Name: "host ipc namespace",
|
|
|
|
+ Description: "allow access to host ipc namespace",
|
|
|
|
+ Value: []string{"true"},
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if c.PidHost {
|
|
|
|
+ privileges = append(privileges, types.PluginPrivilege{
|
|
|
|
+ Name: "host pid namespace",
|
|
|
|
+ Description: "allow access to host pid namespace",
|
|
|
|
+ Value: []string{"true"},
|
|
|
|
+ })
|
|
|
|
+ }
|
|
for _, mount := range c.Mounts {
|
|
for _, mount := range c.Mounts {
|
|
if mount.Source != nil {
|
|
if mount.Source != nil {
|
|
privileges = append(privileges, types.PluginPrivilege{
|
|
privileges = append(privileges, types.PluginPrivilege{
|
|
@@ -744,6 +759,8 @@ func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser,
|
|
DiffIds: []string{layerDigester.Digest().String()},
|
|
DiffIds: []string{layerDigester.Digest().String()},
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ config.DockerVersion = dockerversion.Version
|
|
|
|
+
|
|
configBlob, err := pm.blobStore.New()
|
|
configBlob, err := pm.blobStore.New()
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|