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?

  • What is the location of redis.conf in official docker image?
  • How to install Dockerfile from GitLab to allow pull and commit
  • Docker-compose: Encountered errors while bringing up the project
  • Running torch on docker with CUDA says module 'cutorch' not found
  • Docker Swarm with etcd
  • Docker ignores patterns in .dockerignore
  • “psql: fe_sendauth: no password supplied” when running postgres as a Docker service
  • Docker how to use boolean value on spec.container.env.value
  • Starting a process in the Dockerfile
  • ADD command failing while building dockerfile using docker-build-step plugin in jenkins
  • How to mount volumes to global volume in Docker Swarm and bundle
  • docker-compose up via Windows bat file?
  • 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.