Skip to content

Commit

Permalink
Added flag for changing Docker client version
Browse files Browse the repository at this point in the history
  • Loading branch information
P3GLEG committed Jun 6, 2018
1 parent 10dcc79 commit 50a97cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Usage of ./WhaleTail:
File containing images to analyze seperated by line
-filter
Filters filenames that create noise such as node_modules. Check ignore.go file for more details (default true)
-sV string
Set the docker client ID to a specific version -sV=1.36
-v Print all details about the image
-x Save layers to current directory
```
12 changes: 9 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var verbose = flag.Bool("v", false, "Print all details about the image")
var filter = flag.Bool("filter", true, "Filters filenames that create noise such as" +
" node_modules. Check ignore.go file for more details")
var extractLayers = flag.Bool("x", false, "Save layers to current directory")
var specificVersion = flag.String("sV", "", "Set the docker client ID to a specific version -sV=1.36")
var re *regexp.Regexp

type Manifest struct {
Expand Down Expand Up @@ -311,11 +312,16 @@ func cleanString(str string) string {
}

func main() {
var cli *client.Client
var err error
flag.Parse()
re = regexp.MustCompile(strings.Join(InternalWordlist, "|"))
compile()
cli, err := client.NewClientWithOpts()
defer cli.Close()
if len(*specificVersion) > 0 {
cli, err = client.NewClientWithOpts(client.WithVersion(*specificVersion))
} else{
cli, err = client.NewClientWithOpts()
}
if err != nil {
color.Red(err.Error())
return
Expand All @@ -332,5 +338,5 @@ func main() {
} else {
analyzeMultipleImages(cli)
}

cli.Close()
}

1 comment on commit 50a97cf

@upils
Copy link

@upils upils commented on 50a97cf Jun 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I was able to compile it on windows and run it with docker for windows. Great job and thank you.

Please sign in to comment.