libmachine/versioncmp/compare.go
func compare(v1, v2 string) int {
	// Replace RC string with "." to make the RC number appear as simply
	// another sub-version.
	v1 = strings.Replace(v1, rcString, ".", -1)
	v2 = strings.Replace(v2, rcString, ".", -1)

	// All releases before the community edition (differentiated by
	// presence of the "ce" string in the version string) are "less than"
	// any community edition release (first occurring in March 2017).
	if strings.Contains(v1, ceEdition) && !strings.Contains(v2, ceEdition) {
		return 1
	}
	if !strings.Contains(v1, ceEdition) && strings.Contains(v2, ceEdition) {
		return -1
	}

	// Without this tag, both are pre-CE versions.
	if !strings.Contains(v1, ceEdition) && !strings.Contains(v2, ceEdition) {
		return compareNumeric(v1, v2)
	}

	return compareCE(v1, v2)
}
func compare(v1, v2 string) int {
	// Replace RC string with "." to make the RC number appear as simply
	// another sub-version.
	v1 = strings.Replace(v1, rcString, ".", -1)
	v2 = strings.Replace(v2, rcString, ".", -1)

	// All releases before the community edition (differentiated by
	// presence of the "ce" string in the version string) are "less than"
	// any community edition release (first occurring in March 2017).
	if strings.Contains(v1, ceEdition) && !strings.Contains(v2, ceEdition) {
		return 1
	}
	if !strings.Contains(v1, ceEdition) && strings.Contains(v2, ceEdition) {
		return -1
	}

	// Without this tag, both are pre-CE versions.
	if !strings.Contains(v1, ceEdition) && !strings.Contains(v2, ceEdition) {
		return compareNumeric(v1, v2)
	}

	return compareCE(v1, v2)
}
// compare compares two versions of Docker to decipher which came first.
//
// compare returns -1 if v1 < v2, 1 if v1 > v2, 0 otherwise.