Docker container will automatically stop after “docker run -d”

The centos dockerfile has a default command bash. That means, when run in background (-d), the shell exits immediately. Update 2017 More recent versions of docker authorize to run a container both in detached mode and in foreground mode (-t, -i or -it) In that case, you don’t need any additional command and this is … Read more

Where are Docker images stored on the host machine?

The contents of the /var/lib/docker directory vary depending on the driver Docker is using for storage. By default this will be aufs but can fall back to overlay, overlay2, btrfs, devicemapper or zfs depending on your kernel support. In most places this will be aufs but the RedHats went with devicemapper. You can manually set the storage driver with the -s or –storage-driver= option to the Docker daemon. /var/lib/docker/{driver-name} will contain the driver specific storage for contents … Read more