Sunday 21 May 2017

Running commands for docker container

This is how I'm running a command in a docker container:

$ docker run -it --rm --name myapp myimage:latest
$ node --version

Is it possible to to run this as one command? Can I pass a command to the docker run-command?

Something like

$ docker run -it --rm --name myapp myimage:latest "node --version"

Of course this is just a simple example. Later I will execute some more complex commands...



via user3142695

No comments:

Post a Comment