docker 插件升级

DescriptionUpgrade an existing plugin
Usagedocker plugin upgrade [OPTIONS] PLUGIN [REMOTE]

描述

将现有插件升级到指定的远程插件镜像。如果未指定远程镜像,Docker 将重新拉取当前镜像并使用更新后的版本。所有现有的插件引用将继续有效。在运行升级之前,必须禁用插件。

选项

OptionDefaultDescription
--disable-content-trusttrueSkip image verification
--grant-all-permissionsGrant all permissions necessary to run the plugin
--skip-remote-checkDo not check if specified remote plugin matches existing plugin image

示例

以下示例安装 vieus/sshfs 插件,使用它创建并使用卷,然后升级插件。

$ docker plugin install vieux/sshfs DEBUG=1

Plugin "vieux/sshfs:next" is requesting the following privileges:
 - network: [host]
 - device: [/dev/fuse]
 - capabilities: [CAP_SYS_ADMIN]
Do you grant the above permissions? [y/N] y
vieux/sshfs:next

$ docker volume create -d vieux/sshfs:next -o sshcmd=root@1.2.3.4:/tmp/shared -o password=XXX sshvolume

sshvolume

$ docker run -it -v sshvolume:/data alpine sh -c "touch /data/hello"

$ docker plugin disable -f vieux/sshfs:next

viex/sshfs:next

# Here docker volume ls doesn't show 'sshfsvolume', since the plugin is disabled
$ docker volume ls

DRIVER              VOLUME NAME

$ docker plugin upgrade vieux/sshfs:next vieux/sshfs:next

Plugin "vieux/sshfs:next" is requesting the following privileges:
 - network: [host]
 - device: [/dev/fuse]
 - capabilities: [CAP_SYS_ADMIN]
Do you grant the above permissions? [y/N] y
Upgrade plugin vieux/sshfs:next to vieux/sshfs:next

$ docker plugin enable vieux/sshfs:next

viex/sshfs:next

$ docker volume ls

DRIVER              VOLUME NAME
viuex/sshfs:next    sshvolume

$ docker run -it -v sshvolume:/data alpine sh -c "ls /data"

hello