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?

  • build a data container or point to the existing files in docker?
  • 'ERR_TOO_MANY_REDIRECTS' error nginx docker
  • npm command not available in Docker container
  • Error on script to clear cache docker container
  • What's the difference between Docker for Windows and Docker on Windows?
  • How to make mysql and php work together and without show the database password
  • Does docker run -v or Dockerfile VOLUME take precedence?
  • Openshift doesn't copy docker container files to persistence volume
  • What's the diff between Empty and No Value for Docker Volumes From?
  • tinyproxy not tracing xmlhttprequest
  • Unable to use the “Docker push” command with ECR
  • Unable to start embedded container due to NoClassDefFoundError
  • 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.