So I'm working with a CentOS 8 system that I've updated today. I discovered an issue when using the -l (lowecase L) option today. I haven't tested past using it with the podman exec command (as is covered in the DO180 material).
Doing this in the lab space provided in the RH Academy gives this (it is running Podman 1.6.4), which is expected:
(Edit: The previous image should have shown the command being used with sudo. Doing so in RHALP's lab space does not change the output.)
Doing the same thing in my CentOS 8 system, running Podman 3.0.2-dev, gives this - a bit unexpected:
It doesn't matter is sudo is used or your first switch to the root account, the same error message is thrown.
I wonder: Is this a bug or is it deliberate?
-l uses the latest created container. the error message suggest that container is already terminated.
Note that "latest created container" implies "by the same user" so the latest for your current user (rootless podman) and the latest for the root user (sudo podman) are different containers.
You can use '[sudo] podman ps -l" or -n 1 to check which podman believes is the latest container.
Personally I just avoid using -l and always specify either the container name or id
You miss my point. Look at the second image again. The commands were entered back-to-back. The container was not stopped in between the two commands. This is with Podman 3.0.2-dev
Now I did mess up the first image, which is why I put in the Edit - the commands should have included sudo, as shown in the second image. My point there is that if one were to do the exact same thing under Podman 1.6.4, the version currently being used in the lab space accessible via RHALP, -l works as described in the learning material.
My question about it no longer working in Podman 3.0.2-dev (Is this a bug or is it deliberate?) is my wondering if this were a deliberate change to Podman -- or has a bug introduced?
I, too, don't use -l; I'd rather specify the container by name or ID (tab completion works most time anyway). I brought it up because the option if covered in the DO180 course content.
Oh, I forgot to mention... The -l issue only appears when a container is running as root.
Rootless containers do not exhibit this issue under Podman 3.0.2-dev; using -l works as expected.
Yes, I realize that RH's lab environment is not running Podman 3.0.2-dev. I only bring up this issue because (1) students may be studying for exams on updated systems and (2) as an example that things constantly change and we need to be aware that there can be differences between different versions of software.