Podman:マッピングされた型のTOML値をロードできません。

Podman:マッピングされた型のTOML値をロードできません。

これを保存する必要がありますビデオPodmanの場合、問題があります。レジストリファイル

Podmanがエラーを発生させます。

podman run --name myfirstcontainer -it  -v /home/jhon:/data:Z manjarolinux/base
Error: error loading registries configuration "/etc/containers/registries.conf": toml: cannot load TOML value of type map[string]interface {} into a Go slice

私のレジストリの調整

# [[registry.mirror]]
# location = "example-mirror-0.local/mirror-for-foo"
# [[registry.mirror]]
# location = "example-mirror-1.local/mirrors/foo"
# insecure = true
# # Given the above, a pull of example.com/foo/image:latest will try:
# # 1. example-mirror-0.local/mirror-for-foo/image:latest
# # 2. example-mirror-1.local/mirrors/foo/image:latest
# # 3. internal-registry-for-example.net/bar/image:latest
# # in order, and use the first one that exists.
#
[[registry.mirror]]
prefix ="docker.io"
location = "https://hub.docker.com/r/manjarolinux/base"
insecure =true

何が問題なの?

ベストアンサー1

定義するのはmirror最上位キーに属する配列ですが、単一のオブジェクトを保持するのか、それともオブジェクトの配列を保持するのかはregistry不明です。registry

registry単一オブジェクトとして使用するには

[registry]
[[registry.mirror]]
prefix = "docker.io"
location = "https://hub.docker.com/r/manjarolinux/base"
insecure = true

これはYAML文書に対応します。

registry:
  mirror:
    - prefix: docker.io
      location: https://hub.docker.com/r/manjarolinux/base
      insecure: true

またはJSONドキュメント

{
  "registry": {
    "mirror": [
      {
        "prefix": "docker.io",
        "location": "https://hub.docker.com/r/manjarolinux/base",
        "insecure": true
      }
    ]
  }
}

registryそうすれば大量に(もっと可能性が高いようです)代わりに[[registry]]inを使用すると、YAML対応する文書の前に追加され、JSON対応する文書を含むオブジェクトの周囲に配列構造が追加されます[registry]-mirror[...]mirror

おすすめ記事