From 9ed66591c3b8c46c90657490f53effa22e505f3a Mon Sep 17 00:00:00 2001 From: Reed Allman Date: Wed, 7 Jun 2017 15:48:00 -0700 Subject: [PATCH] need to use >=17.05 (not 17.5), add trimming for weird builds --- fn/common.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fn/common.go b/fn/common.go index ee2dff95b..a7ccfe154 100644 --- a/fn/common.go +++ b/fn/common.go @@ -10,6 +10,7 @@ import ( "os/exec" "path/filepath" "strings" + "unicode" "github.com/coreos/go-semver/semver" @@ -130,7 +131,10 @@ func dockerVersionCheck() error { if err != nil { return fmt.Errorf("could not check Docker version: %v", err) } - v, err := semver.NewVersion(string(out)) + // dev / test builds append '-ce', trim this + trimmed := strings.TrimRightFunc(string(out), func(r rune) bool { return r != '.' && !unicode.IsDigit(r) }) + + v, err := semver.NewVersion(trimmed) if err != nil { return fmt.Errorf("could not check Docker version: %v", err) }