Re: Question about podman load

"Yiding Liu (Fujitsu)" <[email protected]>
Newsgroups org.yoctoproject.lists.meta-virtualization
Message-ID <OS7PR01MB14444C93EBDD1A05EECDEE7FA9B40A@OS7PR01MB14444.jpnprd01.prod.outlook.com>
Hi Bruce
     Thanks for your answer
  -> One workaround is to use a ref that looks like a registry hostname
i.e. contains a dot or colon.

So set:  OCI_IMAGE_TAG = "buildmachine.local/repo:2.0"

1.I tried this function and it shows error in bitbake like:

| DEBUG: OCI: umoci config --image container-base-qemux86-64.rootfs-20260316014248.rootfs-oci:buildmachine.local/repo:2.0 --config.label "org.opencontainers.image.created=2026-03-16T01:42:59Z"                                                                              
| DEBUG: umoci config --image container-base-qemux86-64.rootfs-20260316014248.rootfs-oci:buildmachine.local/repo:2.0  --architecture amd64                                                                              
| ln: failed to create symbolic link 'container-base-buildmachine.local/repo_2.0-oci.tar': No such file or directory                                                                            
| WARNING: exit code 1 from a shell command.                                                                            

2. And podman tag really help me.
# podman tag localhost/repo:2.0 buildmachine.com/repo:2.0

Liu
________________________________
发件人: Bruce Ashfield <[email protected]>
发送时间: 2026年3月13日 21:12
收件人: Liu, Yiding/刘 乙丁 <[email protected]>
抄送: [email protected] <[email protected]>
主题: Re: Question about podman load



On Fri, Mar 13, 2026 at 4:56 AM Yiding Liu (Fujitsu) <[email protected]<mailto:[email protected]>> wrote:
Hi Bruce
    I tryed to load image build from meta-virtualization as following steps.

  1.
Set OCI_IMAGE_TAG to a new value
OCI_IMAGE_TAG = "repo:2.0"

  2.
Load the image

        # podman load -i container-base-repo_2.0-oci.tar

        # podman images
        localhost/repo                             2.0         039d39254c04  14 years ago   5.58 MB

    I found OCI_IMAGE_TAG can specify the image.ref.name<http://image.ref.name> for oci image and loaded by podman,
    it will have a format like  localhost/repo: 2.0.

    My question is that how to specify the REPOSITORY "localhost" to another name?
    For example
        # podman images
        buildmachine/repo                             2.0         039d39254c04  14 years ago   5.58 MB

The short answer is: there's no build time way you can change that, and it
isn't a limitation of anything we've done in meta-virt.

I ran into this when working through the new mult-layer OCI images and
the cross install features. I opted to leave it as-is in those cases, since it
is the default behaviour.

Both podman and docker prepend localhost/ when loading images that
don't have a registry-qualified name.

The OCI ref.name<http://ref.name> annotation in index.json controls the name:tag portion,
but the registry prefix is enforced by the runtime:

Even if ref.name<http://ref.name> is buildmachine/repo:2.0, podman shows
localhost/buildmachine/repo:2.0 (still prepends localhost because
buildmachine doesn't look like a registry — no dots)

One workaround is to use a ref that looks like a registry hostname
i.e. contains a dot or colon.

So set:  OCI_IMAGE_TAG = "buildmachine.local/repo:2.0"

Which would give buildmachine.local/repo:2.0 in podman.

But for arbitrary names without a DNS-style prefix, the simplest
approach is to retag after load:

  podman load -i container-base-repo_2.0-oci.tar
  podman tag localhost/repo:2.0 buildmachine/repo:2.0

That's what I've planned for some normalization of names, but
I haven't done that work yet. So there may be issues lurking that
I'm not aware of.

Bruce



Liu


--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.