Just starting to learn containers so I probably have missed something / not read enough yet, but I have run into a strange behavior and am trying to understand what is happening. I tried googling but haven't been able to find an explanation so I can't tell if I am missing some concepts, running into a some limitation, or encountering a bug.
Basically, when I try to attach to a container, the container stops.
I'm on Fedora 33 using podman v3.1.2 installed from central repos and following the official "Getting Started" guide (here). I am running everything in user-mode (e.g. rootless).
A summary of the initial commands run from the guide:
$ podman pull docker.io/library/httpd >/dev/null
$ podman run -dt -p 8080:80/tcp docker.io/library/httpd
48cf6fbe988a6feb243c62e5298b37f51709251cc05f8d39f17566e1d7fc17f7
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
48cf6fbe988a docker.io/library/httpd httpd-foreground 23 seconds ago Up 22 seconds ago 0.0.0.0:8080->80/tcp cool_cori
$ curl http://localhost:8080
<html><body><h1>It works!</h1></body></html>
$ podman stop -l
48cf6fbe988a6feb243c62e5298b37f51709251cc05f8d39f17566e1d7fc17f7
$ podman rm -l
48cf6fbe988a6feb243c62e5298b37f51709251cc05f8d39f17566e1d7fc17f7
So far so good. Now I was trying to move on from the guide just a little. I wanted to see if I could name the container and also attach to it and run a bash terminal from within the container. I skimmed through man podman-run and added the --name and --hostname parameters which seems to be fine. Also read through man podman-attach and it sounds like it should allow me to get a bash terminal in the container but when I use it, it stops the container.
$ podman run -dt --name "mycontainer" --hostname "testbox" -p 8081:80/tcp docker.io/library/httpd
77e74e729ac0dd86ed5a58aa3481909148de9017ffc52b327f7e69f74da22549
$ curl http://localhost:8081
<html><body><h1>It works!</h1></body></html>
$ podman attach mycontainer
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ podman start mycontainer
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
77e74e729ac0 docker.io/library/httpd httpd-foreground 2 minutes ago Up 8 seconds ago 0.0.0.0:8081->80/tcp mycontainer
$ curl http://localhost:8081
<html><body><h1>It works!</h1></body></html>
$ podman attach mycontainer
[Fri Jul 02 23:35:04.479855 2021] [mpm_event:notice] [pid 1:tid 140188888724608] AH00492: caught SIGWINCH, shutting down gracefully
So is this a bug? Otherwise, what am I doing wrong / why is it behaving this way? Apologies if this is something stupid due to gaps in my knowledge. Also not sure why it stops silently the first time I try attaching to it but it prints a message the next time.
I tried googling the error and got 3 results. One was in Chinese and the other 2 didn't look relevant to my situation. I also turned off SELinux via /etc/selinux/config and rebooted but that didn't make any difference.
Edit: also to clarify, I am using defaults. I have not done anything special for either podman, the image, or the container beyond what is shown in the commands. I do have the cockpit package installed as well but am not using it yet.