docs/features/commands.md
By default the container will execute whatever command is specified in the image's Dockerfile. To override this, and specify a different command, use withCommand. For example:
Specifying a startup command inside_block:startupCommand
<!--/codeinclude-->Your test can execute a command inside a running container, similar to a docker exec call:
Executing a command inside a running container inside_block:standaloneExec
<!--/codeinclude-->This can be useful for software that has a command line administration tool. You can also get the output (stdout/stderr) and exit code from the command - for example:
<!--codeinclude-->Executing a command inside a running container and reading the result inside_block:execReadingStdout
<!--/codeinclude-->To add environment variables to the container, use withEnv:
new GenericContainer(...)
.withEnv("API_TOKEN", "foo")