def run_via_binary_in_foreground(<EOL>self, run_command_instance=None, command=None, volumes=None,<EOL>additional_opts=None, popen_params=None, container_name=None):
logger.info("<STR_LIT>")<EOL>if (command is not None or additional_opts is not None)and run_command_instance is not None:<EOL><INDENT>raise ConuException(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if run_command_instance is None:<EOL><INDENT>command = command or []<EOL>additional_opts = additional_opts or []<EOL>if (isinstance(command, list) or isinstance(command, tuple) and<EOL>isinstance(additional_opts, list) or isinstance(additional_opts, tuple)):<EOL><INDENT>run_command_instance = DockerRunBuilder(<EOL>command=command, additional_opts=additional_opts)<EOL><DEDENT>else:<EOL><INDENT>raise ConuException("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>run_command_instance = run_command_instance or DockerRunBuilder()<EOL>if not isinstance(run_command_instance, DockerRunBuilder):<EOL><INDENT>raise ConuException("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>popen_params = popen_params or {}<EOL>run_command_instance.image_name = self.get_id()<EOL>if container_name:<EOL><INDENT>run_command_instance.options += ["<STR_LIT>", container_name]<EOL><DEDENT>if volumes:<EOL><INDENT>run_command_instance.options += self.get_volume_options(volumes=volumes)<EOL><DEDENT>def callback():<EOL><INDENT>return subprocess.Popen(run_command_instance.build(), **popen_params)<EOL><DEDENT>container_id, popen_instance = self._run_container(run_command_instance, callback)<EOL>actual_name = self.d.inspect_container(container_id)['<STR_LIT:Name>'][<NUM_LIT:1>:]<EOL>if container_name and container_name != actual_name:<EOL><INDENT>raise ConuException(<EOL>"<STR_LIT>"<EOL>+ str(container_name) + "<STR_LIT>" + str(actual_name))<EOL><DEDENT>if not container_name:<EOL><INDENT>container_name = actual_name<EOL><DEDENT>return DockerContainer(<EOL>self, container_id, popen_instance=popen_instance, name=container_name)<EOL>
Create a container using this image and run it in foreground;
this method is useful to test real user scenarios when users invoke containers using
binary and pass input into the container via STDIN. You are also responsible for:

 * redirecting STDIN when intending to use container.write_to_stdin afterwards by setting
      popen_params={"stdin": subprocess.PIPE} during run_via_binary_in_foreground

 * checking whether the container exited successfully via:
      container.popen_instance.returncode

Please consult the documentation for subprocess python module for best practices on
how you should work with instance of Popen

:param run_command_instance: instance of DockerRunBuilder
:param command: list of str, command to run in the container, examples:
    - ["ls", "/"]
    - ["bash", "-c", "ls / | grep bin"]
:param volumes: tuple or list of tuples in the form:

    * `("/path/to/directory", )`
    * `("/host/path", "/container/path")`
    * `("/host/path", "/container/path", "mode")`
    * `(conu.Directory('/host/path'), "/container/path")` (source can be also
        Directory instance)

:param additional_opts: list of str, additional options for `docker run`
:param popen_params: dict, keyword arguments passed to Popen constructor
:param container_name: str, pretty container identifier
:return: instance of DockerContainer