Skip to content

Equivalent of docker run? #696

Answered by cristianrgreco
dmurat asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @dmurat. That's interesting I haven't heard of the One shot startup strategy being referred to as a docker run equivalent before, but I see why it is. This startup strategy doesn't yet exist in testcontainers-node.

However you can achieve the same outcome quite easily:

const container = await new GenericContainer("alpine")
  .withCommand("echo hello world")
  .start()

In this case the container will run the command and exit.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dmurat
Comment options

Answer selected by dmurat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants