Пример #1
0
func imageIDFromList(d dockerclient.Client, imageName string) (string, error) {
	images, err := d.ListImages()
	if err != nil {
		return "", stackerr.Wrap(err)
	}

	for _, i := range images {
		for _, t := range i.RepoTags {
			if t == imageName {
				return i.Id, nil
			}
		}
	}

	return "", nil
}