0

When I do

curl -X POST -v --unix-socket /var/run/docker.sock http://docker/containers/container_name/start

I got response codes like 204, 304, 404, 502

How to get the same response codes from the golang docker client? As of now, startcontainer function in golang is only returning an error string

dockerclient function:

ContainerStart(ctx context.Context, containerID string, options dockTypes.ContainerStartOptions) error
charanReddy
  • 137
  • 1
  • 11
  • 1
    Unfortunately you're not going to get the response codes, the Moby client only ensures the response object is closed, and does not return it. You can check it out here: https://github.com/moby/moby/blob/master/client/container_start.go#L11 – lindluni Jun 22 '19 at 07:24
  • Got it....thank you :) – charanReddy Jun 24 '19 at 09:04

0 Answers0