Running docker containers in different modes
1)We can run docker containers for executring only certain tasks
docker run <imagename>
This will execute the task mentioned in cmd or entrypoint and then container stops
2) We can also run containers for long running applicaitons.
In this scenario, we can run container interatively and/or in daemon mode
– Running docker in interactive mode :
This will take you into bash shell of the container where you can execute commands.
docker run -it <imageName> /bin/bash
– Running docker in daemon mode: Doing this will run the container in the background.
Later you can go into the container interactively.
docker run -d <imageName> /bin/bash