func (c *ImagesCollector) Collect(inputDirectory string, outputPath string) error {
	outputPath = filepath.Join(outputPath, "images")
	err := os.MkdirAll(outputPath, common.DefaultDirectoryPermission)
	if err != nil {
		logrus.Errorf("Unable to create output directory %s : %s", outputPath, err)
		return err
	}
	imageNames, err := getImageNames(inputDirectory)
	if err != nil {
		return err
	}
	logrus.Debugf("Images : %s", imageNames)
	for _, imageName := range imageNames {
		imagedata, err := getDockerInspectResult(imageName)
		if err != nil {
			continue
		}
		if imagedata != nil {
			imageInfo := getImageInfo(imagedata)
			shortesttag := ""
			for _, tag := range imageInfo.Spec.Tags {
				if shortesttag == "" {
					shortesttag = tag
				} else {
					if len(shortesttag) > len(tag) {
						shortesttag = tag
					}
				}
			}
			imagefile := filepath.Join(outputPath, common.NormalizeForFilename(shortesttag)+".yaml")
			err := common.WriteYaml(imagefile, imageInfo)
			logrus.Errorf("Unable to write file %s : %s", imagefile, err)
		}
	}
	return nil
}
Collect gets the image metadata using docker inspect
package collector
import (
	"encoding/json"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"strings"
	sourcetypes "github.com/konveyor/move2kube/collector/sourcetypes"
	"github.com/konveyor/move2kube/common"
	collecttypes "github.com/konveyor/move2kube/types/collection"
	"github.com/sirupsen/logrus"
	"github.com/spf13/cast"
)
type ImagesCollector struct {
}
func (c ImagesCollector) GetAnnotations() []string {
	annotations := []string{"k8s", "dockerswarm", "dockercompose"}
	return annotations
}