0

I'm attempting to find the equivalent of

docker run -it networkstatic/nflow-generator -t localhost -p 9995

when using the docker API (I'm using dockerode, but an answer for the HTTP api is just as good). I tried this with no luck:

docker.createContainer({
  Image: 'networkstatic/nflow-generator',
  Args: [ '-t', 'streamsets-dc', '-p', '9995' ]
});

How do I pass arguments without a command?

waternova
  • 1,472
  • 3
  • 16
  • 22

1 Answers1

0

Since the networkstatic/nflow-generator Dockerfile already defines its entrypoint as /go/bin/nflow-generator, you should be able to pass these arguments into the running container as commands like this:

 docker.createContainer({
   Image: 'networkstatic/nflow-generator',
   Cmd: [ '-t', 'streamsets-dc', '-p', '9995' ]
 });
ivan.sim
  • 8,972
  • 8
  • 47
  • 63