Docker API from CLI
Docker has command line programs, but they are not well suited to automation. Return values and pars-able output are both lacking, but there is an API that you can use instead. The Dockerd api can listen on a local socket or even a remote accessible port, but in these examples I'll show local socket only.