You started a container and podman ps shows nothing. Or a podman run command stops on a name or port error that you do not understand. These situations almost always come from three things: a container lives only as long as its process, a stopped container still exists, and a low port is forbidden to an ordinary user.
This page teaches the basic podman commands on a throwaway image, with the output of each step. To understand why Podman has no central service and what rootless means, see the core concepts (in French). What comes after: volumes (in French), networks (in French), advanced options of run (in French), pods (in French), Quadlet (in French) and building images (in French).
What you will learn
- Download an image and refer to it by its full name
- Run a container in the foreground, in the background or as a throwaway, with
--name,-dand--rm - List containers, read their logs, run a command inside one, read a field with
inspect --format - Stop, restart and remove a container, and read the exit codes 125, 126 and 127
- Publish a port and mount a folder in rootless mode, knowing the limits
Prerequisites
You know how to open a terminal, create a folder with mkdir and move around with cd. Podman is installed (installation, in French) and the podman --version command answers. curl is used in the section on ports and in exercise 2. No root right is needed: everything runs under your own account.
Create the practice folder
One folder and one variable are enough for the whole page. The IMG variable holds the busybox image pinned by its digest (@sha256:…): the digest guarantees that you run exactly the same image as on the page, even if the 1.37 tag is published again. data/f.txt is used in the section on volumes. Before you start, podman images shows the images you already have: the final cleanup removes only the ones this page downloads.
podman imagesmkdir ~/podman-lab && cd ~/podman-labmkdir data && printf 'hello\n' > data/f.txtIMG=docker.io/library/busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ecmkdir stops if the folder already exists. The IMG variable lives in the current terminal: if you open another one, retype the last line. Every container you name carries the cmd- prefix (cmd-web, cmd-actif…), which lets you find and remove them without touching your own. If podman ps -a --filter 'name=^cmd-' already lists some, pick another prefix.
The outputs come from Debian 13 with Podman 5.4.2. When AlmaLinux 10.3 (Podman 6.1.4) answers differently, the difference is pointed out. The latest stable version of Podman is 6.2.1, published on November 24, 2026; the commands on this page have not been tested on it. The names that Podman invents (tender_lewin further down) and the identifiers will be different on your machine. The warning lines about the systemd session, described in the troubleshooting section, are left out of the outputs.
The podman command in detail
podman reads from left to right: the program, the action, the options of that action, the image, then the command to run inside the container. Each piece of the line below is explained, with the result of the complete line.
Anatomy of the command
Syntaxpodman run [options] image [command]
podmanrun--rm--name cmd-essai$IMGecho bonjour -
podmanthe programIt manages images and containers, without a central service. -
runthe actionCreate a container and start it. -
--rmthe cleanupoptionalRemove the container when it ends. -
--name cmd-essaithe nameoptionalTo refer to it later. -
$IMGthe imageHere in a variable, pinned by its digest. -
echo bonjourthe commandoptionalReplaces the one set by the image.
Outputbonjour
Full syntax
The form is podman run [options] image [command]. Everything written before the image is read by Podman; everything written after is passed to the container, as arguments of the command. An option placed after the image is therefore no longer a Podman option: --rm is taken for the program to run in the container. The "Exit codes" section shows the error you get.
How podman run creates a container, step by step
Predict before you look at the map. After podman run --rm --name cmd-essai $IMG echo bonjour, what does the list of containers contain? What happens to the output bonjour when you add -d? What happens if you run the command twice without --rm and with the same --name? Then tick -d and --rm in the options, move forward step by step and watch the screen on the right.
Mental model
What podman run does with a container
create the containerrun its processthe process ends, the container stops a container lives as long as its process
Try Life of the cmd-essai container
Create, run, end
podman ps -a
$ podman run --name cmd-essai $IMG echo bonjour; podman ps -a --format '{{.Names}} {{.State}}'
- Podman creates the cmd-essai container from the busybox image. It does not start yet.
- The echo process starts and writes bonjour. Its output reaches your screen.
- echo has nothing left to do: it ends with code 0, and the container stops with it.
- The container is stopped but still exists. Its name is taken: a second run --name cmd-essai would fail.
What the animation shows
- One process, one life: when it ends, the container stops.
- Stopped is not removed:
podman ps -astill shows it. - `-d` hides the output,
podman logsfinds it again. - `--rm` removes everything at the end, logs included.
Golden rules
Name your containers
Without --name, podman makes up a name:
podman run -d --name cmd-web $IMG sleep 3600Look at the stopped ones too
ps alone shows only those running:
podman ps -aEssential vocabulary
Run · a container
run- See the output
podman run --name cmd-essai $IMG echo bonjour→ bonjour --rm- Keep nothing
podman run --rm $IMG true; podman ps -a --format '{{.Names}} {{.State}}'→ no container --name- The name already taken
podman run --name cmd-essai $IMG true; podman run --name cmd-essai $IMG true 2> /dev/null; echo $?→ code 125 $?- The command that fails
podman run --rm $IMG false; echo $?→ code 1
Follow · and clean up
logs- The output of a container
podman run -d --name cmd-essai $IMG echo bonjour > /dev/null; sleep 1; podman logs cmd-essai→ bonjour exec- Enter a container
podman run -d --name cmd-web $IMG sleep 3600 > /dev/null; podman exec cmd-web echo ok→ ok rm- Remove a running container
podman run -d --name cmd-web $IMG sleep 3600 > /dev/null; podman rm cmd-web 2> /dev/null; echo $?→ code 2 stop- Stop, then the state
podman run -d --name cmd-web $IMG sleep 3600 > /dev/null; podman stop -t 1 cmd-web > /dev/null 2>&1; podman ps -a --format '{{.Names}} {{.State}}'→ exited
Download an image
podman pull downloads an image into your local storage, without running anything. The full name reads registry/namespace/image:tag: here docker.io is the registry, library the namespace of official images, busybox the image and 1.37 the tag. After the tag, @sha256:… pins the exact image.
podman pull $IMGpodman imagesTrying to pull docker.io/library/busybox@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec...[...]30ecbe1509090b38ef3260f3609d64d8261230464eaa4d235901db496e9647fbREPOSITORY TAG IMAGE ID CREATED SIZEdocker.io/library/busybox <none> 30ecbe150909 2 years ago 4.67 MBLook at the first line of pull: the 1.37 tag has disappeared, only the name and the digest remain. When a name carries both a tag and a digest, Podman drops the tag and stores the image as name@sha256:…. The next line is the image identifier. podman images therefore shows <none> in TAG.
A short name works too, but check what it downloads:
podman run --rm busybox echo court # ❌ image not pinnedResolved "busybox" as an alias (/etc/containers/registries.conf.d/shortnames.conf)Trying to pull docker.io/library/busybox:latest...[...]courtPodman found busybox in an alias file and downloaded latest, a different image from the one on this page, with no error. Always write the full name with a tag or the digest. An unknown short name stops with code 125:
podman run --rm zzz-inexistant echo xError: short-name "zzz-inexistant" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"On AlmaLinux (Podman 6.1.4), run without a terminal, the message is Error: short-name resolution enforced but cannot prompt without a TTY, with the same code. In a terminal, it shows instead a Please select an image: menu that offers registry.access.redhat.com/zzz-inexistant:latest, registry.redhat.io/zzz-inexistant:latest and docker.io/library/zzz-inexistant:latest: do not pick any, quit with Ctrl+C.
Run a container
podman run creates a container from an image, starts it and runs the requested command. Without -d, it stays in the foreground and prints the output of the command in your terminal.
podman run $IMG echo bonjourbonjourThe echo command ends, so the container stops but still exists. It has no name: Podman invents one. --name sets one, --rm removes the container when it ends. To work inside it, -it opens an interactive terminal (-i keeps the input open, -t provides a terminal): with podman run -it --rm $IMG sh, the prompt becomes / #, and exit leaves the shell and, with --rm, removes the container.
List containers
podman ps shows the running containers. podman ps -a adds the stopped ones. Right after the previous echo bonjour, the first command shows only the header:
podman pspodman ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESa111cbd9a3c4 docker.io/library/busybox@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec echo bonjour Less than a second ago Exited (0) Less than a second ago tender_lewinLook at the STATUS column: Exited (0) means the process ended with code 0, without error. IMAGE shows the image with its digest, like pull. NAMES shows the invented name: yours will be different, write it down. --format chooses the columns, with a Go template: podman ps -a --format '{{.Names}} {{.Status}}' prints only the name and the status.
Run a container in the background
-d (detach) gives you your terminal back right away. podman run -d prints the full container identifier (64 characters); podman ps shows the beginning of it. The sleep 3600 process lasts one hour, which leaves you time to work on it.
podman run -d --name cmd-web $IMG sleep 3600podman ps55512b17ee714b3c8e68937e32a27ef17173c9c9f099a97d8364118f1fab5d0fCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES55512b17ee71 docker.io/library/busybox@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec sleep 3600 Less than a second ago Up Less than a second cmd-webA container that stops immediately
A container lasts as long as its process. Started with -d, a command that ends at once leaves the container stopped, without any message:
podman run -d --name cmd-bavard $IMG echo ligne1The output is the container identifier, nothing else. ps no longer shows it, ps -a shows it as Exited (0): the container did not fail, its command was already finished.
Read the logs
podman logs reads again what the container's process wrote to its output, even after the container has ended: this is the usual way to recover the output of a container started with -d. With -d --rm, the container disappears when its process ends, and its logs with it.
podman logs cmd-bavardligne1-f follows new lines as they arrive and does not give the terminal back: Ctrl+C interrupts it. So that the example does not block your terminal, timeout 5 cuts the command after 5 seconds, and echo $? then prints the exit code of the previous command: 0 if it succeeded, another number otherwise.
podman run -d --name cmd-tic $IMG sh -c 'for i in 1 2 3; do echo tic$i; sleep 1; done; sleep 3600'timeout 5 podman logs -f cmd-tic; echo $?tic1tic2tic3124Run a command in a container
podman exec runs a command inside a container that is already running, without creating a new one. The container must be running.
podman exec cmd-web hostname55512b17ee71Compare this host name with the identifier that ps shows for cmd-web. Yours will be different.
Control the container lifecycle
A container is running, stopped or removed, and each command in this section moves it from one state to another. Look at the middle state: a stopped container stays on disk with its name, podman start restarts it, and only podman rm removes it.
podman stop asks the process to stop (the SIGTERM signal), waits 10 seconds by default, then kills it (SIGKILL). Your sleep did not react to the first signal: a process started directly in a container is process number 1 there, which the kernel treats differently (see advanced podman run, in French).
time podman stop cmd-webpodman stop cmd-bavardpodman ps -atime="2026-11-25T17:00:27Z" level=warning msg="StopSignal SIGTERM failed to stop container cmd-web in 10 seconds, resorting to SIGKILL"cmd-web
real 0m10.151scmd-bavardCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES[...]55512b17ee71 docker.io/library/busybox@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec sleep 3600 16 seconds ago Exited (137) Less than a second ago cmd-web[...]The warning says that SIGTERM was not enough and that Podman moved on to SIGKILL, hence the 10 seconds of real. Under zsh, time prints a single line and the duration is labelled total. The Exited (137) status is the trace of it: a process killed by SIGKILL ends with 137, which is 128 plus the signal number 9. -t 1 shortens the wait to one second. podman kill sends SIGKILL directly: tested on a sleep container, it gave the terminal back in 0.1 seconds and the status was also Exited (137).
podman exec refuses a stopped container, and its exit code is not 0:
podman exec cmd-web hostname; echo $?Error: can only create exec sessions on running containers: container state improper255podman start restarts a stopped container with the files it had written: it is not recreated from the image.
podman start cmd-webpodman exec cmd-web sh -c 'echo gardé > /tmp/k'podman stop -t 1 cmd-webpodman start cmd-webpodman exec cmd-web cat /tmp/kpodman stop -t 1 cmd-webcmd-web[...]gardé[...]The /tmp/k file written before the first stop is still there after the second start.
A stopped container still exists. podman rm removes it, and accepts several names: podman rm cmd-bavard cmd-web removes them in one go and prints their names. Removing a running container is refused. Create cmd-actif, then try:
podman run -d --name cmd-actif $IMG sleep 3600podman rm cmd-actif; echo $?Error: cannot remove container 8998738e4b70963d7cce164424a2e9367250cf008fc6db57adb37fb5742ae7c7 as it is running - running or paused containers cannot be removed without force: container state improper2The message says what to do: stop first (podman stop), or force with podman rm -f, which stops then removes. The exit code is 2. An image used by a container, even a stopped one, cannot be removed either: podman rmi $IMG answers image is in use by a container with code 2. Remove the containers first.
Container name already in use
A name stays taken as long as the container is not removed, whether it runs or not. cmd-actif still exists, so:
podman run --name cmd-actif $IMG true; echo $?Error: creating container storage: the container name "cmd-actif" is already in use by 8998738e4b70963d7cce164424a2e9367250cf008fc6db57adb37fb5742ae7c7. You have to remove that container to be able to reuse that name: that name is already in use, or use --replace to instruct Podman to do so.125The message gives both ways out: remove the existing container, or add --replace, which removes the container with the same name before creating the new one, even if it is running. Code 125 is detailed in the "Exit codes" section.
A background container that fails
You start in the background a container named cmd-job whose command is sh -c 'echo avant; exit 3'. podman run -d prints no error, and you want to know what happened.
Run it, then find the failure
Start cmd-job with -d on the image in the IMG variable and print the exit code with echo $?. Then list all containers, note the exit code of cmd-job, and read its logs.
- podman run -d
- podman ps -a
- podman logs
I have tried: show the solution
podman run -d --name cmd-job $IMG sh -c 'echo avant; exit 3'; echo $?podman ps -apodman logs cmd-jobf96ecea38d3249941172f8a82308cc7fac58b8b0622ef626afa10a1f3b16fa200[...]f96ecea38d32 docker.io/library/busybox@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec sh -c echo avant;... Less than a second ago Exited (3) Less than a second ago cmd-jobavantpodman run -d returns 0: it says that the container started, not that its command succeeded. Code 3 is read in the STATUS column of ps -a, and podman logs shows what the container wrote before it failed. With -d, an error in the container is not displayed: look at ps -a, then logs.
Publish a port
A container has its own network: to reach it from the host, -p host:container publishes a port. The first number is the host's, the second is the container's. httpd -f -p 80 is a small busybox web server that listens on port 80 of the container.
podman run -d --name cmd-p8080 -p 8080:80 $IMG httpd -f -p 80podman port cmd-p808080/tcp -> 0.0.0.0:8080Read the arrow: port 80 of the container is reachable on port 8080 of all the host's addresses (0.0.0.0). Test the server from the host with curl (-i prints the response header, head -1 keeps only its first line):
curl -s -i http://localhost:8080 | head -1HTTP/1.1 404 Not FoundThe 404 comes from the busybox server, which has no page to serve: the container holds no file at the requested address. This code proves that port 8080 of the host does reach the container's server.
To open the port only to the local machine, add the address: -p 127.0.0.1:8082:80. A port already taken by another container makes the start fail.
podman run -d --name cmd-local -p 127.0.0.1:8082:80 $IMG httpd -f -p 80podman port cmd-localpodman run -d --name cmd-doublon -p 8080:80 $IMG httpd -f -p 80; echo $?80/tcp -> 127.0.0.1:8082Error: pasta failed with exit code 1:Failed to bind port 8080 (Address already in use) for option '-t 8080-8080:80-80'
126On AlmaLinux (Podman 6.1.4), the message is Listen failed for HOST TCP port */8080: Address already in use then Couldn't listen on requested ports, with the same code 126.
Privileged ports in rootless mode
On Linux, an unprivileged account cannot listen on ports below 1024: the threshold is set by net.ipv4.ip_unprivileged_port_start, which is 1024 by default. In rootless mode, podman runs under your account: publishing port 80 of the host is refused.
podman run -d --name cmd-p80 -p 80:80 $IMG httpd -f -p 80; echo $?Error: pasta failed with exit code 1:Failed to bind port 80 (Permission denied) for option '-t 80-80:80-80'
126On AlmaLinux (Podman 6.1.4), the message is Listen failed for HOST TCP port */80: Permission denied then Couldn't listen on requested ports, with the same code 126. pasta is the component that connects the container's network to the host's in rootless mode. Publish a port greater than or equal to 1024 (-p 8080:80): the container still listens on port 80 inside, only the host's port changes. The page on Podman networks (in French) details pasta and what you can configure.
Inspect a container
podman inspect prints everything Podman knows about a container, as JSON. --format keeps only the requested fields, with a Go template. First create a container that fails, in the foreground this time:
podman run --name cmd-sortie $IMG false; echo $?podman inspect --format '{{.State.Status}} {{.State.ExitCode}}' cmd-sortie1exited 1The first 1 is the exit code of podman run: in the foreground, it repeats the code of the container's command (false returns 1). inspect finds it again in .State.ExitCode, with the state in .State.Status. Now read the IP address, the image and the process number of cmd-p8080:
podman inspect --format '{{.NetworkSettings.IPAddress}}|{{.Config.Image}}|{{.State.Pid}}' cmd-p8080|docker.io/library/busybox@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec|6220The first field is empty: for this rootless container, .NetworkSettings.IPAddress gives no address, and you must not count on it to reach a service. Go through the published port, or through a network created for the purpose: after podman network create cmd-net and podman run -d --name cmd-n1 --network cmd-net $IMG sleep 3600, the command podman inspect --format '{{(index .NetworkSettings.Networks "cmd-net").IPAddress}}' cmd-n1 prints 10.89.0.2, whereas .NetworkSettings.IPAddress stays empty even there (Podman networks, in French). The second field shows the image with its digest, without a tag, like ps. The third is the process number on the host; yours will be different.
Rerun on another port
Earlier, publishing port 80 failed with an error message, and you moved on. You now want the service to answer on port 8081, under the same name cmd-p80.
Look at what is left
List all containers with podman ps -a and note the status of cmd-p80.
Make the service answer on 8081
Rerun cmd-p80 publishing port 8081 of the host to port 80 of the container (same image, same httpd -f -p 80 command, in the background), without removing the container by hand. Then query port 8081 with curl -s -o /dev/null -w '%{http_code}\n', which prints only the HTTP code.
- podman ps -a
- podman run --replace
- curl
I have tried: show the solution
podman ps -apodman run -d --replace --name cmd-p80 -p 8081:80 $IMG httpd -f -p 80curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8081In ps -a, the line of cmd-p80 shows the status Created and the port 0.0.0.0:80->80/tcp: Podman created the container before running into port 80, and never started it. Without --replace, the rerun fails: the name is taken, code 125. With --replace, the Created container is replaced, and curl returns 404, the same code as on port 8080. A podman run that fails at startup leaves a Created container: remove it (podman rm) or rerun with --replace.
Exit codes
In the foreground, podman run returns the code of the container's command when that command ran, and its own codes otherwise. With -d, the code only says that the container started: the code of the command is read afterwards in ps -a. The ones that the tests on this page produced:
| Code | What it says | Example from the page |
|---|---|---|
| 0 / 1 | In the foreground, the code of the container's command; with -d, 0 only says that the container started | echo bonjour, false |
| 2 | Podman refuses the operation: running container, image in use | podman rm cmd-actif, podman rmi $IMG |
| 125 | Error from podman itself, before running the command | name already taken, unknown short name |
| 126 | The container was created, but could not start; Podman's documentation also describes it for a command that is present but not executable | port 80 refused, port already in use (Debian and AlmaLinux); the container stays Created |
| 127 | The requested command is not found in the image | --rm placed after the image |
| 255 | exec on a stopped container, a code that Podman's documentation does not describe | podman exec cmd-web hostname after the stop |
To see a 127, place the --rm option after the image:
podman run --name cmd-mal $IMG --rm echo bonjour; echo $?Error: crun: executable file `--rm` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found127The message says that --rm does not exist as a program in the image. A command that really does not exist, like podman run --rm $IMG commande-inexistante, returns the same message and the same code. Read the error message before the code: the same number can have different causes. Code 126 also exists for a file that is present but not executable:
podman run --rm $IMG /etc/passwd; echo $?Error: crun: the path `/etc/passwd` exists but it is not executable: Operation not permitted: OCI permission denied126Volumes and lost data
The files a container writes in its own file system disappear with it: a container started with --rm is removed along with what it contained, and a new container starts again from the image. The first container below writes a file and reads it back; the second no longer finds it:
podman run --rm $IMG sh -c 'echo ecrit > /tmp/t.txt; cat /tmp/t.txt'podman run --rm $IMG cat /tmp/t.txtecritcat: can't open '/tmp/t.txt': No such file or directoryTo keep data, mount a host folder with -v host-folder:container-folder. If getenforce answers Enforcing on your machine (SELinux active), add :Z at the end of the mount, for example -v ~/podman-lab/data:/data:Z: according to Podman's documentation, this suffix changes the SELinux label of the folder so that a single container can access it (:z to share it between containers). It has not been tried with SELinux active. With the practice folder mounted on /data, the file written by the container also exists on the host:
podman run --rm -v ~/podman-lab/data:/data $IMG sh -c 'echo ecrit > /data/g.txt'cat ~/podman-lab/data/g.txtls -l ~/podman-lab/dataecrittotal 8-rw-r--r-- 1 ansible ansible 6 Nov 25 17:00 f.txt-rw-r--r-- 1 ansible ansible 6 Nov 25 17:00 g.txtLook at the owner of g.txt: it is your account (ansible on the test machine), although the container wrote it as root. Named volumes and their backups are covered in the page Podman volumes (in French).
Permission denied on a volume
In rootless mode, your account appears as root in the container. The other identifiers of the container (1 to 65536) correspond to the range that /etc/subuid reserves for your account: on the test machine, ansible:165536:65536. Your data folder belongs to you, so root can write in it; the container's identifier 1000 is, for the kernel, another account, which has only the "other" rights of the folder (755, read-only). If a non-root user of the container must write in a mounted folder, see the page Podman volumes (in French). To see the refusal without creating an account, run the same write with --user 1000:
podman run --rm --user 1000 -v ~/podman-lab/data:/data $IMG touch /data/xtouch: /data/x: Permission deniedWhich command should I use?
This page covers the basic operations. For other needs, here is where to go.
| Need | Command or page |
|---|---|
| Copy a file between the host and a container | podman cp file container:/path, and podman cp container:/path file the other way |
| See the memory and CPU of running containers | podman stats --no-stream |
| Limit memory or CPU, environment variables, health check | advanced podman run (in French) |
| Make two containers talk, DNS, ports | Podman networks (in French) |
Troubleshooting
Start with podman ps -a: the container you are looking for is almost always there, stopped or never started.
| Symptom | Cause | Solution |
|---|---|---|
Failed to bind port 80 (Permission denied), Listen failed for HOST TCP port */80 or Address already in use (code 126) | Port below 1024 refused to a normal account, or port already taken; the container stays Created | Publish a free port from 1024 up: -p 8080:80; podman rm the Created container |
cannot remove container … as it is running or image is in use by a container (code 2) | Running container, or a container that still uses the image | podman stop name or podman rm -f name, then remove the image |
Permission denied when writing in a mounted folder, while getenforce answers Enforcing | The SELinux label of the folder is not the container's | Add :Z to the mount: -v folder:/data:Z |
Four level=warning lines before the output, often repeated a second time, including The cgroupv2 manager is set to systemd but there is no systemd user session available (seen on Debian 13 and AlmaLinux 10.3 in an SSH session) | SSH session without a systemd user session | Open a real session, or follow the message: loginctl enable-linger followed by your user number, as root. The lines disappeared once the user session was available |
Clean up the practice folder
This page created the containers prefixed with cmd-, a container with a name invented by Podman (the echo bonjour at the start, tender_lewin in the outputs), images and the ~/podman-lab folder. First check what the filter selects, note the invented name in podman ps -a, then remove only those. podman rm -f on a name that does not exist prints no error. The podman network rm cmd-net line is only needed if you created that network in the "Inspect a container" section.
podman ps -a --filter 'name=^cmd-'podman rm -f $(podman ps -aq --filter 'name=^cmd-')podman rm -f NOM_INVENTEpodman network rm cmd-netpodman imagesThe ^cmd- filter keeps only the names that start with cmd-: a container autre-cmd-x stays in place. In the image list, compare with the one you noted at the start, and remove busybox (the latest tag) and the image of $IMG only if they were not there. Reread the name before running rm -r.
podman rmi busyboxpodman rmi $IMGcd ~ && rm -r ~/podman-labKey points
- A container lives as long as its process:
podman ps -afinds it again when stopped,podman logsreads its output. Stopped is not removed: the name stays taken untilpodman rm, and arunthat failed at startup leaves aCreatedcontainer. With-d, a failure is read inps -athenlogs. - Options go before the image: placed after it,
--rmbecomes the command to run and the code is 127. - Write the image with its full name and a tag or a digest: a short name can download
latest, with no error. stopwaits 10 seconds beforeSIGKILL(code 137);rmrefuses a running container,rmian image in use (code 2).- In rootless mode, publish a port from 1024 up. What the container writes outside a volume disappears with it.
Knowledge check
The questions cover the container lifecycle, ports in rootless mode, volumes and reading a failure. The pass mark is 80%.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
A new full quiz with random questions
Work again only on the questions you missed