Last active
June 12, 2016 22:53
-
-
Save odewahn/c283a74d52b5265c2adbbb7340c5d160 to your computer and use it in GitHub Desktop.
Example of how to search your own public repos using samalba client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/samalba/dockerclient" | |
) | |
// Helpful: | |
// http://stackoverflow.com/questions/24814714/docker-remote-api-pull-from-docker-hub-private-registry | |
// http://rancher.com/comparing-four-hosted-docker-registries/ | |
func main() { | |
docker, _ := dockerclient.NewDockerClient("unix:///var/run/docker.sock", nil) | |
term := "" // leave this blank to get everything, or put in a value if you want to search | |
results, err := docker.SearchImages(term, "index.docker.io/odewahn", nil) | |
if err != nil { | |
log.Fatal(err) | |
} | |
for _, c := range results { | |
fmt.Println(c.Name) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment