Skip to main content

Pull, Inspect, and Run Containers

1. Setup: View Your Podman Storage Tree

Before running containers, inspect where Podman stores its image and container data.

podman info --format 'Graph Root: {{.Store.GraphRoot}}, RunRoot: {{.Store.RunRoot}}'
tree -L 1 /scratch/$USER/.local/share/containers/storage/

You should see directories like overlay/, overlay-images/, and volumes/.

2. Pull an Official Image

Lets find available images for Ubuntu. Specifically we want Ubuntu version 24.04, which has Long-Term Support. Notice we wil search the docker.io container registry.

Search for an Image on Dockerhub

podman search docker.io/ubuntu

⚠️ Always try to pull official images where possible.

Search for an Official Image

podman search --filter is-official=true docker.io/ubuntu

ℹ️ Notice that the official image is listed from library. The docker.io library lists official images

Searching tags with Skopeo

There is no easy way to list all tags for a remote reposiutory using docker or podman directly. You can use the open-source container signing, manipulating, and inspecting tool skopeo.

skopeo list-tags docker://docker.io/library/ubuntu

ℹ️ At this point, most people would just navigate to the official Docker Hub and look at library/ubuntu to find available tags.

Finally, pulling the ubuntu:24.04 image.

podman pull docker.io/library/ubuntu:24.04

Now we can see the ubuntu:24.04 image locally. Alternatively use podman image ls.

podman images

ℹ️ Notice the relatively small size at ~80MB. This is a minimal image lacking many of the ammenities you may be used to including X11-utils.

3. Run Your First Container

podman run -it --name firstdemo ubuntu:24.04

Once inside:

ls -a

Exit the container:

exit (or use Ctrl + D)

List containers:

podman container ls

ℹ️ Notice no containers are listed. Only running containers are shown with ls alone.

List containers (running and exited):

podman container ls -a

4. Try a Disposable Container

podman run -it --rm --name tempdemo ubuntu:24.04

Exit again and verify the container is gone:

podman container ls -a

ℹ️ When running containers in batch environments, prefer to remove the container upon exiting unless debugging issues.

5. Reuse the Name

podman will prevent you from overwriting an image without the --replace tag. If containers are created without a name, they will be given a random identifier that will be unique.

podman run -it --name firstdemo ubuntu:24.04

6. Authenticate with a Registry

To push containers, youy will need to create a Docker Hub account and log in. Follow the instructions online, or in Container Registries

podman login docker.io

To use JLab’s registry (codecr):

podman login codecr.jlab.org
Username: <your_cue_id>
Password: <your_personal_access_token>

7. Push a container to your Namespace

At this time, we have no container image to push! Continue through the getting started guide to the container build section.