We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My code is here:
type Container struct { ID string ...... Volumes map[string]string VolumesRW map[string]bool // Add by Li Bin HostConfig *HostConfig } // Add by Li Bin func (p *HostConfig) unmarshal(raw json.RawMessage) bool { if err := json.Unmarshal(raw, p); err != nil { return false } return true } func (c *Client) InspectContainer(id string) (*Container, error) { path := "/containers/" + id + "/json" body, status, err := c.do("GET", path, nil) if status == http.StatusNotFound { return nil, &NoSuchContainer{ID: id} } if err != nil { return nil, err } var container Container err = json.Unmarshal(body, &container) if err != nil { return nil, err } // Add by Li Bin var doc struct { Things []json.RawMessage `json:"things"` } err = json.Unmarshal(body, &doc) if err != nil { return nil, err } for _, thing := range doc.Things { host := new(HostConfig) if host.unmarshal(thing) { container.HostConfig = host } } return &container, nil }
The text was updated successfully, but these errors were encountered:
The PortBindings is returned by Container.NetworkSettings https://github.com/fsouza/go-dockerclient/blob/master/container.go#L195
PortBindings
Container.NetworkSettings
Sorry, something went wrong.
Got it, thanks
No branches or pull requests
My code is here:
The text was updated successfully, but these errors were encountered: