[Bug] GenericContainer doesn’t properly split commands
See original GitHub issueModule
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
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Issues · testcontainers/testcontainers-java - GitHub
[Bug]: PostgreSQLContainer fails to startup intermittently under GitHub Actions (not ... [Bug] GenericContainer doesn't properly split commands type/bug.
Read more >GenericContainer (TestContainers Core 1.3.0 API) - Javadoc.io
Convenience class with access to non-public members of GenericContainer. ... Run a command inside a running container, as though using "docker exec".
Read more >Gitlab runner dind service cannot be used with Testcontainers
To work around this issue, I've had to have two stages, one to do the maven commands directly, and then another stage to...
Read more >Deprecate Shell.GenericContainer (!153) · Merge requests
Turns out that this MR doesn't break it -- it is already non-functional in master. And I don't want to pollute this already...
Read more >Micronaut Framework/questions - Gitter
Hi, I'm using micronaut 3.7.4 which doesn't appear to have the latest micronaut openapi version so apologize if fixed. I have some @Controllers...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@REslim30 Thanks for the insight. I can see where non-POSIX commands could be a probably.
I currently have a workaround in place, so it’s not blocking me.
It actually might be a shell thing. From
man bash