1、docker trust revoke 简介
docker trust revoke
命令用于撤销对镜像的信任。
Docker trust revoke
从已签名仓库中的标签中移除签名。
参考文档:https://docs.docker.com/engine/reference/commandline/trust_revoke/
2、docker trust revoke 语法
docker trust revoke [OPTIONS] IMAGE[:TAG]
3、docker trust revoke 命令
1)撤销已签名标签的签名
下面是一个包含两个已签名标签的仓库示例:
docker trust inspect --pretty example/trust-demo SIGNED TAG DIGEST SIGNERS red 852cc04935f930a857b630edc4ed6131e91b22073bcc216698842e44f64d2943 alice blue f1c38dbaeeb473c36716f6494d803fbfbe9d8a76916f7c0093f227821e378197 alice, bob List of signers and their keys for example/trust-demo: SIGNER KEYS alice 05e87edcaecb bob 5600f5ab76a2 Administrative keys for example/trust-demo: Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949
当其中一个签名者 alice 执行 docker trust revoke 命令时:
docker trust revoke example/trust-demo:red Enter passphrase for delegation key with ID 27d42a8: Successfully deleted signature for example/trust-demo:red
在撤销后,该标签将从已发布标签列表中移除:
docker trust inspect --pretty example/trust-demo SIGNED TAG DIGEST SIGNERS blue f1c38dbaeeb473c36716f6494d803fbfbe9d8a76916f7c0093f227821e378197 alice, bob List of signers and their keys for example/trust-demo: SIGNER KEYS alice 05e87edcaecb bob 5600f5ab76a2 Administrative keys for example/trust-demo: Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949
2)撤销仓库中所有标签的签名
当没有指定标签时,docker trust 会撤销您拥有签名密钥的所有标签的签名。
docker trust inspect --pretty example/trust-demo SIGNED TAG DIGEST SIGNERS red 852cc04935f930a857b630edc4ed6131e91b22073bcc216698842e44f64d2943 alice blue f1c38dbaeeb473c36716f6494d803fbfbe9d8a76916f7c0093f227821e378197 alice, bob List of signers and their keys for example/trust-demo: SIGNER KEYS alice 05e87edcaecb bob 5600f5ab76a2 Administrative keys for example/trust-demo: Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949
当其中一个签名者 alice 执行 docker trust revoke 命令时:
docker trust revoke example/trust-demo Please confirm you would like to delete all signature data for example/trust-demo? [y/N] y Enter passphrase for delegation key with ID 27d42a8: Successfully deleted signature for example/trust-demo
所有具有 alice 签名的标签都将从已发布标签列表中移除:
docker trust inspect --pretty example/trust-demo No signatures for example/trust-demo List of signers and their keys for example/trust-demo: SIGNER KEYS alice 05e87edcaecb bob 5600f5ab76a2 Administrative keys for example/trust-demo: Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949
4、命令选项
选项 | 描述 |
--yes , -y | 不提示确认 |
5、相关命令
命令 | 描述 |
docker trust inspect | 返回有关密钥和签名的低级信息 |
docker trust key | 管理用于签名 Docker 镜像的密钥 |
docker trust revoke | 取消对镜像的信任 |
docker trust sign | 对镜像进行签名 |
docker trust signer | 管理可以对 Docker 镜像进行签名的实体 |