如何启用实验性Docker CLI功能 [英] How to enable experimental Docker CLI features
问题描述
我正在尝试使用 docker manifest inspect<图像名称>
,但是Docker CLI表示...
I'm trying to use docker manifest inspect <image name>
, but the Docker CLI says...
$ docker manifest inspect node
docker manifest inspect is only supported on a Docker cli with experimental cli features enabled
考虑到Docker文档的丰富性,很难找到这个简单的问题。
Considering the wealth of Docker documentation, this simple question is surprisingly difficult to search for.
如何启用实验性CLI功能?
How do I enable experimental CLI features?
推荐答案
有两种方法可以解决此问题:
There are a couple of ways to solve this problem:
-
指定环境变量
Specify the environment variable
export DOCKER_CLI_EXPERIMENTAL =已启用
这为测试实验性功能提供了一个临时环境,而无需承诺其使用。
This provides a temporary environment for testing the experimental features without having to commit to it's usage.
Docker配置文件
Docker config file
添加实验性:已启用
到〜/ .docker / config.json
(默认位置)位于文件开头,而不是文件末尾(重要细节)
Add "experimental": "enabled"
to ~/.docker/config.json
(default location) at the beginning of the file and not at the end (important detail)
注意:仅当您运行
docker login
后,才会显示Docker配置文件
这是最好的选择,如果您想永久启用实验模式。
NOTE: The Docker config file only appears after you have run
docker login
for the first time. This is the best option, if you wish to permanently enable experimental mode.
这篇关于如何启用实验性Docker CLI功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!