Run command in background does not work

My aim is to start docker in background. Due to some issues with services, I want to start docker manually in background.

Here my approach, where I run the docker daemon in background, so I don’t have the output on the command line and the command line is not blocked by the process.

  • Questions about Mesos Linux container and Docker
  • Cant produce-to OR consume-from kafka broker running inside a container
  • Docker compose detached mode not working
  • How to correctly link php-fpm and Nginx Docker containers?
  • Reach host with Docker Compose
  • Dockerfile vs Docker image
  • HTTP_PROXY= HTTPS_PROXY= docker -d > docker.log &

    But my approach does not work. The output is displayed on the command line and the command line is blocked by the process. Any ideas? Thank you.

  • How to run nodemon and different gulp tasks in a docker container
  • Integrating Docker with jenkins for continuous integration
  • Using Github Project in Docker
  • Docker compose build error
  • openwhisk postdeploy fails on single node ubuntu virtual machine
  • Content of a Docker Image that is pushed to DockerHub
  • One Solution collect form web for “Run command in background does not work”

    You need to redirect standard error as well. On my machine, this worked for me and was silently running in the background…

    sudo docker -d 2> docker.err.log > docker.log &

    Edit: And yes, as that_other_guy correctly pointed out, if you don’t redirect stderr and put it in the background with &, (as you have) the console output just makes it look like its still running in the foreground.

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