Example #1
0
func generateImage(name string, srv *docker.Server) error {
	archive, err := fakeTar()
	if err != nil {
		return err
	}
	return srv.ImageImport("-", "repo", name, archive, ioutil.Discard, utils.NewStreamFormatter(true))
}
Example #2
0
func GetVersion() string {
	srv := docker.Server{}

	//srv, err := docker.server.NewServer()
	//runtime := mkRuntime()
	//srv := &Server{runtime: runtime}

	api := srv.DockerVersion()

	//FIXME Need sudo on my machine
	/*
	 *if images, err := srv.ImagesSearch("ubuntu"); err != nil {
	 *    fmt.Println("Error, handles it dude")
	 *} else {
	 *    for _, image := range images {
	 *        fmt.Println(image)
	 *    }
	 *}
	 */

	return api.Version
}