Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for stdin-once #20267

Open
lefinal opened this issue Oct 4, 2023 · 7 comments
Open

Add support for stdin-once #20267

lefinal opened this issue Oct 4, 2023 · 7 comments
Labels
HTTP API Bug is in RESTful API kind/feature Categorizes issue or PR as related to a new feature. stale-issue

Comments

@lefinal
Copy link

lefinal commented Oct 4, 2023

Feature request description

This feature request comes from working with the Docker Go SDK that allows setting StdinOnce when creating a container. This closes stdin for the container after the first attached client (to stdin) disconnects.
Podman currently does not support this, so applications that read from an input stream (in this case stdin) will hang until stopped manually.

Suggest potential solution

Add an stdin-once flag for container creation. If set, stdin to the container is closed after the first attached client (to stdin) disconnects.

Have you considered any alternatives?

No response

Additional context

The struct in Docker Go SDK:
https://pkg.go.dev/github.com/docker/[email protected]+incompatible/api/types/container#Config

Already existing annotation for container inspect details in Podman Go bindings:

StdinOnce bool `json:"StdinOnce"`

@lefinal lefinal added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 4, 2023
@rhatdan
Copy link
Member

rhatdan commented Oct 5, 2023

Interested in opening a PR?

Copy link

github-actions bot commented Nov 5, 2023

A friendly reminder that this issue had no activity for 30 days.

@rhatdan rhatdan added HTTP API Bug is in RESTful API and removed stale-issue labels Nov 5, 2023
@rhatdan
Copy link
Member

rhatdan commented Nov 5, 2023

@Luap99 PTAL

@lefinal
Copy link
Author

lefinal commented Nov 5, 2023

Sorry for the late reply. I tried to look into it but I am having a hard time understanding the codebase. From what I got, it seems like conmon does not have support for this. I already opened a discussion at containers/conmon#459 but got no response, yet.

@Luap99
Copy link
Member

Luap99 commented Nov 6, 2023

A command like podman-remote run --rm -i alpine cat - <<<"test" works so this should technically already work without such parameter. cat - wouldn't exit if the stdin is not closed.

@Luap99
Copy link
Member

Luap99 commented Nov 6, 2023

This was the fix for it it: fbce758
So as long a your client closes the writing side of the socket it should behave correctly.

That of course does not need to mean that we shouldn't support this API parameter.

Copy link

github-actions bot commented Dec 9, 2023

A friendly reminder that this issue had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTTP API Bug is in RESTful API kind/feature Categorizes issue or PR as related to a new feature. stale-issue
Projects
None yet
Development

No branches or pull requests

3 participants