Vaccano
Vaccano

Reputation: 82351

Podman images not showing with podman image ls

I am trying to setup a build server in a Red Hat Enterprise Linux 8 (CentoOS 8) virtual machine.

I installed podman by running sudo dnf install -y @container-tools

I then ran sudo podman pull mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim to pull a container image from docker:

Trying to pull mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim...Getting image source signatures
Copying blob e936bd534ffb done
Copying blob caf64655bcbb done
Copying blob 4156e490f05f done
Copying blob 68ced04f60ab done
Copying blob 7064c3d93b4a done
Copying config e2cd20adb1 done
Writing manifest to image destination
Storing signatures
e2cd20adb1292ef24ca70de7abaddaadd57a5c932d3852b972e43b6f05a03dea

This looks successful to me. And if I run it again, I get told that the layers "already exists". But then I run:

podman image ls

and I get an empty list back:

REPOSITORY TAG IMAGE ID CREATED SIZE

I also tried the following commands to get a list:

They all give an empty list.

How can I see the container image that I pulled down?

Update: I ran sudo podman run --rm --name=linuxconfig-test -p 80:80 httpd and (on another machine) browsed to the ip address of my linux machine and got It Works! shown. So podman is working at least in part.

Upvotes: 2

Views: 18494

Answers (4)

Andrew Schetinin
Andrew Schetinin

Reputation: 343

I had a similar problem after pulling a local image from the local Docker.

The pull was successful, and Podman stopped displaying any images after that.

Executing sudo podman image ls also returned an empty list, but it magically resolved the regular podman image ls under my current user, and all images (including the new one pulled from the Docker) started displaying.

Upvotes: 2

Alex Punnen
Alex Punnen

Reputation: 6234

You can use the --root option to give the path to where the images are stored. That is if you need to run as root.

Though one important part of using podman is that you do not need to run as root or sudo user.

Note - The moment you run this, podman will change the owner of certain folders and files in the overlay location,and later when you run without sudo , you need to chown back. So not recommended

sudo podman images --root  /home/xxx/.local/share/containers/storage

Upvotes: 1

Michael Seifert
Michael Seifert

Reputation: 992

Unlike Docker, Podman stores images in the home directory of the user. The default path is ~/.local/share/containers/storage and it can be verified by running podman info. Since you executed podman pull as root, the pulled image will be stored in the home directory of the root user. This is why no images are listed when you run podman image ls without sudo.

The main idea behind podman is that it can run entirely in user mode without connecting to a priviledged daemon. Ideally, all podman commands should be run without sudo.

Upvotes: 14

Vaccano
Vaccano

Reputation: 82351

Turns out you have to run using sudo. I ran :

sudo podman image ls

and it returned the list of container images.

Upvotes: 1

Related Questions