Skip to content

[Bug] GenericContainer doesn’t properly split commands #5784

@dhoard

Description

@dhoard

Module

Core

Testcontainers version

1.17.3

Using the latest Testcontainers version?

Yes

Host OS

ALL

Host Arch

ALL

Docker version

N/A

What happened?

GenericContainer setCommand uses Java String split to build the array of command parts. If the command contains quoted arguments/quoted arguments with escaped quotes, the container fails.

Example command:

/bin/sh test.sh “argument 1” “argument 2”

Relevant log output

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions