0

I need to fetch this image for podman but there is a problem on registry.conf

podman gives error

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

my registry adjust

# [[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

what is wrong

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
maxemilian
  • 121
  • 8
  • 1
    Found this issue on Github: https://github.com/containers/podman/issues/5764 . Looks like a 'registry' block is required in addition the 'registry.mirror' block. – Haxiel Jun 21 '21 at 10:21
  • thanks this issue topic helped too much, solved my problem.`unqualified-search-registries`, `[[registry]]` and [[registry.mirror]] – maxemilian Jun 21 '21 at 11:40

1 Answers1

1

What you are trying to define is an array, mirror, belonging to the top-level key registry, but it's unclear whether registry holds a single object or an array of objects.

To use registry as a single object,

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

This corresponds to the YAML document

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

or the JSON document

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

If the registry is supposed to be an array (which seems more likely), then use [[registry]] in place of [registry], which would add a - in front of mirror in the YAML equivalent document, and a [...] array structure around the object containing mirror in the JSON equivalent.

Kusalananda
  • 320,670
  • 36
  • 633
  • 936