Skip to content

Code runner do not receive EOT #6

Description

@vovaparker

When I call 'coderunner' inside the Docker container and provide stdin, 'coderunner' does not receive the EOT signal.

Example: ` val dockerClient = DockerClientImpl.getInstance(config, dockerHttpClient)

    val container = dockerClient.createContainerCmd(imageName)
        .withTty(true)
        .withStdinOpen(true)
        .withUser("codegeet")
        .withWorkingDir("/home/codegeet")
        .exec()

    dockerClient.startContainerCmd(container.id).exec()

    val execCmd = dockerClient.execCreateCmd(container.id)
        .withAttachStdout(true)
        .withAttachStdin(true)
        .withAttachStderr(true)
        .withCmd("java", "-jar", "coderunner.jar")
        .exec()

    val execStartCmd = dockerClient.execStartCmd(execCmd.id)

    val inputStream = PipedInputStream()
    val outputStream = PipedOutputStream(inputStream)

    val stdinWriter = outputStream.bufferedWriter()
    stdinWriter.write("{}\n" )

    stdinWriter.flush()
    stdinWriter.close()

    execStartCmd.withStdIn(inputStream).exec(MyResultCallback()).awaitCompletion(5, TimeUnit.SECONDS)

`

'coderunner' just waits stdin EOT signal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions