skip to Main Content

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:

  • podman image ls -a
  • podman image list
  • podman image list -a
  • podman images
  • podman images ls
  • podman images ls -a
  • podman images list
  • podman images list -a

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.

3

Answers


  1. Chosen as BEST ANSWER

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

    sudo podman image ls
    

    and it returned the list of container images.


  2. 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.

    Login or Signup to reply.
  3. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search