podman run --cidfile without --detach only writes the id after completion #8091
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Steps to reproduce the issue:
podman pull alpine
(or any container for that matter)podman run -it --cidfile cid alpine sh
(keep the command running)cat cid
cat cid
Describe the results you received:
In step 3, the
cid
file doesn't contain a container id, only in step 5.Describe the results you expected:
In step 3 there should have already been a container id.
This is becaue the ID only gets written after running the container has finished, which is only after the container was stopped when not passing
--detach
:podman/cmd/podman/containers/run.go
Lines 188 to 201 in 94873a2
Ideally this should be fixed so that the cid is written for an already running container.
If this can't be easily fixed, or won't be fixed, at least the documentation should be updated to contain that information!
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
physical
The text was updated successfully, but these errors were encountered: