Docker Run Images with option via Golang Docker SDK #43964
-
Hi All,
Please guide me how we may pass the option parameters. I am unable to find sample for the same. Thansk |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Wow , 3 years and no answers .
you might want to take a look at |
Beta Was this translation helpful? Give feedback.
-
For anyone else that lands here from Google trying to figure out how to filter images using ImageListOptions. The filters are based on what is available in the Docker API for ImageList, not what is available on types.ImageSummary or anything else in the Go SDK. For example if you wanted to find a particular image this won't work; f := filters.NewArgs()
f.Add("RepoTags", "debian:10.12") You have to do: f.Add("reference", "debian:10.12") Then you can get the results like this: images, _ := m.client.ImageList(m.ctx, types.ImageListOptions{All: false, Filters: f}) |
Beta Was this translation helpful? Give feedback.
-
The way |
Beta Was this translation helpful? Give feedback.
The way
docker run
works is it first calls the create endpoint, if the image isn't available then it returns a 404.docker run
sees that 404 and initiates a pull, then does another create.