I use golang to develop application . I want get container in application.I hava tired by shell.But I want to get container by go. thanks
You can use docker/client
https://godoc.org/github.com/docker/docker/client
More about docker engine SDKs and API
https://docs.docker.com/develop/sdk/
Example:
cd $GOPATH/src/
go get github.com/docker/docker/client
git clone git@gist.github.com:786bf953cff14bfdf8dfb413e5bfcbf4.git
cd 786bf953cff14bfdf8dfb413e5bfcbf4
DOCKER_API_VERSION=1.35 go run listcontainers.go