Skip to content

Separate stdout/stderr when run docker exec #704

@philpep

Description

@philpep

Hi, I would like to known how to distinguish stdout and stderr when exec inside a running container through docker-py:

>>> client = docker.Client()
>>> container = client.create_container("ubuntu", cmd="tail -f /dev/null")
>>> client.start(container)
>>> e = client.exec_create(container, ["ls", "-l", "/root", "/nonexistent"])
>>> client.exec_start(e)
'ls: cannot access /nonexistent: No such file or directory\n/root:\ntotal 0\n'
>>> # Stdout and stderr are mixed here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions