Few usefull cmd for easier docker managment:

  1. To delete all errored out container: docker rm $(docker ps -q -f status=exited).
  2. To force container keep running without exit: tail -f /dev/null.
  3. Sometime you may have error X509: certificate signed by unknown authority docker error with wellknown CA signed certs, add cert locally to get rid of it:
$ sudo mv registry.example.com.crt /usr/local/share/ca-certificates
# update global certificates definitions
$ sudo update-ca-certificates
# restart affected services
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
  1. Use docker save -o <path for generated tar file> <image name> to save local docker image and scp to other host, then docker load -i <path to image tar file> to load docker image with an old tag.