gpt4 book ai didi

image - docker-有关命名图像的限制

转载 作者:行者123 更新时间:2023-12-04 18:58:52 25 4
gpt4 key购买 nike

我对有关图像命名的限制有疑问。我在网上搜索,看到了不同的问题和答案。

docker镜像名称中不允许使用哪些特殊字符? (例如'*','$',',','_'...)
可以使用大写字符作为图像名称吗?

最佳答案

https://github.com/docker/distribution/blob/master/reference/regexp.go:

// nameComponentRegexp restricts registry path component names to start
// with at least one letter or number, with following parts able to be
// separated by one period, one or two underscore and multiple dashes.



这适用于图像名称本身。
  • 字母的正则表达式全部为小写字母,没有大写字母。
  • 您可以在开头的冒号后面包含一个主机名和一个可选的端口号。
  • 您可以在主机名和图像名称之间包含路径,并使用斜线/,并且路径的每个元素与图像名称本身具有相同的限制。
  • 在图像名称之后,您可以在冒号之后添加一个标记,或者在@之后添加一个摘要。

  • 用方括号括起来的符号表示:
    [somehost.com[:1234]][/some-path/to/the]image-name[:myTag1.2.3]
    [somehost.com[:1234]][/some-path/to/the]image-name[@ca468b84b84846e84...]

    关于image - docker-有关命名图像的限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43091075/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com