Skip to content

Instantly share code, notes, and snippets.

@mvetsch
Last active March 9, 2016 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvetsch/eadb38b07048305ba74f to your computer and use it in GitHub Desktop.
Save mvetsch/eadb38b07048305ba74f to your computer and use it in GitHub Desktop.
Use docker's fantastic namegenerator
#!/bin/bash
wget https://raw.githubusercontent.com/docker/docker/master/pkg/namesgenerator/names-generator.go 2> /dev/null
go get "github.com/docker/docker/pkg/random"
go get "github.com/docker/docker/pkg/namesgenerator"
cat > get-generated-name.go << EOF
package main
import "github.com/docker/docker/pkg/namesgenerator"
import "fmt"
func main() {
fmt.Printf(namesgenerator.GetRandomName(0) + "\n")
}
EOF
go build get-generated-name.go
./get-generated-name
@mvetsch
Copy link
Author

mvetsch commented Mar 9, 2016

Go must be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment