Docker错误:无效的引用格式:存储库名称必须为小写 [英] Docker error: invalid reference format: repository name must be lowercase

查看:799
本文介绍了Docker错误:无效的引用格式:存储库名称必须为小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用我的一个项目遇到此Docker错误:

Ran into this Docker error with one of my projects:

无效的引用格式:存储库名称必须为小写

产生此通用消息的各种原因是什么?

What are the various causes for this generic message?

经过一番努力,我已经弄清楚了,因此,我将回答我自己的问题,以便在此处进行记录,因为在进行Web搜索时解决方案不会立即出现,并且因为此错误消息并未描述Docker遇到的直接问题。

I already figured it out after some effort, so I'm going to answer my own question in order to document it here as the solution doesn't come up right away when doing a web search and also because this error message doesn't describe the direct problem Docker encounters.

推荐答案

泊坞窗中的引用是指向图像的指针。它可以是图像名称,图像ID,名称中包括注册表服务器,使用sha256标记固定图像以及可用于指向要运行的图像的其他任何东西。

A "reference" in docker is a pointer to an image. It may be an image name, an image ID, include a registry server in the name, use a sha256 tag to pin the image, and anything else that can be used to point to the image you want to run.

无效的引用格式错误消息表示docker无法将您提供的字符串转换为图像。这可能是无效的名称,或者可能是由于早先 docker run 命令行中的解析错误(如果您是通过这种方式运行图像的)。对于撰写文件,如果在图像名称中扩展变量,则该变量可能无法正确扩展。

The invalid reference format error message means docker cannot convert the string you've provided to an image. This may be an invalid name, or it may be from a parsing error earlier in the docker run command line if that's how you run the image. With a compose file, if you expand a variable in the image name, that variable may not be expanding correctly.

docker运行中命令行,这通常是导致不用空格引用参数,而导致命令行顺序错误的结果。命令行的顺序为:

With the docker run command line, this is often the result in not quoting parameters with spaces, and mistaking the order of the command line. The command line is ordered as:

docker ${args_to_docker} run ${args_to_run} image_ref ${cmd_to_exec}

将args传递给运行过程中最常见的错误是卷映射扩展了路径名,其中包含空格,而不引用路径或转义空格。例如,

The most common error in passing args to the run is a volume mapping expanding a path name that includes a space in it, and not quoting the path or escaping the space. E.g.

docker run -v $(pwd):/data image_ref

而且修复很容易:

docker run -v "$(pwd):/data" image_ref

这篇关于Docker错误:无效的引用格式:存储库名称必须为小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆