Ditrobox ignores local podman image (toolbox is fine with it)

Hello,

I’m trying to create a custom boxkit as per this post

Now, this process only works with toolbox. I was under the impression distrobox is also able to use podman images though? Is that incorrect?

When I try distrobox it keeps trying to pull the image that I have built locally:

❯ podman image ls localhost/mybox:latest
REPOSITORY               TAG         IMAGE ID      CREATED        SIZE
localhost/mybox          latest      aca579be4780  4 minutes ago  2.23 GB

❯ export DBX_CONTAINER_MANAGER=podman

❯ distrobox create -n test --image localhost/mybox:latest
Trying to pull localhost/mybox:latest...
WARN[0000] Failed, retrying in 1s ... (1/3). Error: initializing source docker://localhost/mybox:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused 
WARN[0001] Failed, retrying in 1s ... (2/3). Error: initializing source docker://localhost/mybox:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused 
WARN[0002] Failed, retrying in 1s ... (3/3). Error: initializing source docker://localhost/mybox:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused 
Error: initializing source docker://localhost/mybox:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

Why is distrobox trying to pull the image that exists locally?

This same thing works fine with toolbox. Is this a podman/distrobox compatibility issue?

1 Like

Wasted a lot of time on this, but here’s the culprit:

❯ cat /etc/distrobox/distrobox.conf 
container_always_pull="1"
container_generate_entry=1
container_manager="podman"
container_name_default="ubuntu"
container_image_default="ghcr.io/ublue-os/ubuntu-toolbox:latest"
non_interactive="1"

It seems to me that container_always_pull="1" was the reason for this. I guess the default configuration is to force-pull? I don’t know why this is so…

Anyway, to get around this, I used the relevant environment variable:

DBX_CONTAINER_ALWAYS_PULL=0 DBX_CONTAINER_MANAGER=podman distrobox create -n test --image localhost/mybox:latest

Hopefully this saves someone some time…

4 Likes