File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/main/groovy/com/avast/gradle/dockercompose/tasks Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,9 @@ class ComposeUp extends DefaultTask {
105105 if (dockerHost) {
106106 logger. debug(" 'DOCKER_HOST environment variable detected - will be used as hostname of service $serviceName '" )
107107 new ServiceHost (host : dockerHost. toURI(). host, type : ServiceHostType.RemoteDockerHost )
108- } else if (isMac()) {
109- // If running on Mac OS and DOCKER_HOST is not set, we can assume that
110- // we are using Docker for Mac, in which case we should connect to localhost
108+ } else if (isMac() || isWindows() ) {
109+ // If running on Mac OS or Windows, and DOCKER_HOST is not set, we can assume that
110+ // we are using Docker for Mac/Windows , in which case we should connect to localhost
111111 logger. debug(" Will use localhost as host of $serviceName " )
112112 new ServiceHost (host : ' localhost' , type : ServiceHostType.LocalHost )
113113 } else {
@@ -225,4 +225,8 @@ class ComposeUp extends DefaultTask {
225225 private static boolean isMac () {
226226 System . getProperty(" os.name" ). toLowerCase(). startsWith(" mac" )
227227 }
228+
229+ private static boolean isWindows () {
230+ System . getProperty(" os.name" ). toLowerCase(). startsWith(" win" )
231+ }
228232}
You can’t perform that action at this time.
0 commit comments