Difference between docker -d and doing ctrl-p+ctrl-q after launching interactively?

Is docker -d more efficient than simply first running interactively with docker -i -t and then detaching with ctrl-p + ctrl-q?

On my production server, I need to change some config settings after running the container. I could commit those config changes and start a new container from this image, but I’d rather just keep it in the first container and detach. Any dangers to this approach?

  • Kubernetes docker sample does not expose a port
  • docker-compose --x-networking up not working
  • Why do we need run update before run install in Dockerfile?
  • Detect if my app runs in Azure
  • Hashes in `docker pull wordpress`
  • DevOps vs Docker
  • How to make changes to the code inside a Docker Container?
  • gdb does not hit any breakpoints when I run it from inside Docker container
  • LINKERD: Unable to build docker image from linkerd
  • LetsEncrypt-ACMESharp http-01 challenge on IIS invalid
  • Access docker-api without CLI installed
  • Can not deploy custom MFP docker image on IBM Bluemix
  • One Solution collect form web for “Difference between docker -d and doing ctrl-p+ctrl-q after launching interactively?”

    Having all your configurations in the Dockerfile and running docker -d is more efficient. Even if it means creating multiple Dockerfiles with unique configurations for each container.

    The downside with configuring the container then detaching each time is that, its the manual way of doing things, which defeats the purpose of the Dockerfile. Also, it will take more time to replicate your container on another environment.

    You can also explore using Docker Environment Variables, or Reading a configuration file from a Docker Volume to make your setup more dynamic.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.