Skip to content

Conversation

@0xF0D0
Copy link

@0xF0D0 0xF0D0 commented Dec 30, 2025

I've added open_stdin option on container request.

Ping me if any tests should be added.

@netlify
Copy link

netlify bot commented Dec 30, 2025

Deploy Preview for testcontainers-rust ready!

Name Link
🔨 Latest commit 8088e4f
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-rust/deploys/69536b04e299ab0008c689c6
😎 Deploy Preview https://deploy-preview-904--testcontainers-rust.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DDtKey
Copy link
Contributor

DDtKey commented Jan 2, 2026

Hi @0xF0D0 and thanks for the contribution!

May I ask you to provide some details about your use-case? Do you try to use some cli-based container?
Doesn't exec functionality cover your needs?

@0xF0D0
Copy link
Author

0xF0D0 commented Jan 5, 2026

Not quite actually.
First things first, what I'm trying to do here is using testcontainer-rs is writing integration tests with containers while mimicking network by stdin, stdout. From each container's perspective, input packets are passed from stdin, and send output packets to stdout.

so AFAIK exec does not hook every stdout so I had to turn this stdin option.

Here's my sample code

        let docker_client = testcontainers::core::client::docker_client_instance()
            .await
            .unwrap();
        let result = docker_client
            .attach_container(
                &node_name,
                Some(AttachContainerOptions {
                    stdin: true,
                    detach_keys: None,
                    logs: false,
                    stream: true,
                    stdout: false,
                    stderr: false,
                }),
            )
            .await
            .unwrap();

        let mut stdin = result.input;

this stdin does not work unless I turn this open_stdin option.

I was also wondering if could add stdin just like stdout but seemed like it would change far more codes than this pr so I felt I should ask how you feel about this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants