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.

  • Docker on bare metal (with some form of hypervisor) vs. on full fledged Linux distribution
  • Where to hold Application Files - Docker
  • Python psycopg2 - Work with large data
  • How restart a stopped docker container
  • In jenkins, docker-compose mysql 0mERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'@'%'
  • Download Github build artifact (release) using wget/curl
  • 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.

  • Is there any point in Dockerizing a remote Git repository?
  • Schedule a container with docker swarm using gpu memory as a constraint
  • Docker - failed to connect to running image
  • Confluent Platform : Update Schema Registry to use Avro 1.8.1 and use new build in docker and host
  • Deploy docker container to production preserving mounted volumes
  • SSL certificate verification fails inside docker container on specific server
  • 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.