Replace `docker.Xxx` helpers with functions on `command.Command` (#2288)
* DockerCommand.exec accepts io.Writer
DockerCommand.exec will write the underlying command stdout and stderr to the provided io.Writer. This allows callers to either capture the entire output or allow long running commands to stream output to a writer that isn't os.Stdout or os.Stderr
* upgrade docker/docker
github.com/docker/docker needed an upgrade, but this wasn't compatible with a dependency of goreleaser, so I removed it from go tools
* Move several docker CLI helpers to the docker interface and implementation
Several helper functions in the `docker` package (`ImageInspect`, `ImageExists`, `ContainerInspect`, `ContainerLogsFollow`, and `Pull`) invisibly shelled out to the docker CLI, often with slightly different logic than was the `DockerCommand` struct was doing.
This PR moves them to functions on the `DockerCommand` struct as well as adds them to the `command.Command` interface so they can be swapped out with the upcoming engine client.
* add docker client integration tests
test harness for running integration tests against an actual docker daemon and local registry
* port docker.Stop to command.ContainerStop
* force alpine test fixture to platform/amd64
* handle Pull errors from both dockerd & containerd
different errors are returned when working with a docker registry and OCI registry. This maps both of them to the not found error
* fix tests & lint
* Pull returns the inspect response and has a force param
There's a few places in the code where we check for a local image, and if not found begin a pull, then carry on. I had a bug that allowed pull failures to be swallowed and stale inspect responses to be passed to predict+train.
This fixes the issue by ensuring that Pull returns the inspect response of the image that was just pulled, or to skip pulling if the image already exists using a force flag.