diff --git a/src/main/groovy/com/avast/gradle/dockercompose/tasks/ComposeDown.groovy b/src/main/groovy/com/avast/gradle/dockercompose/tasks/ComposeDown.groovy index a0ad8be..294730f 100644 --- a/src/main/groovy/com/avast/gradle/dockercompose/tasks/ComposeDown.groovy +++ b/src/main/groovy/com/avast/gradle/dockercompose/tasks/ComposeDown.groovy @@ -22,9 +22,6 @@ class ComposeDown extends DefaultTask { extension.setExecSpecWorkingDirectory(e) e.environment = extension.environment String[] args = ['stop', '--timeout', extension.dockerComposeStopTimeout.getSeconds()] - if (extension.removeOrphans()) { - args += '--remove-orphans' - } e.commandLine extension.composeCommand(args) } if (extension.removeContainers) { @@ -41,6 +38,9 @@ class ComposeDown extends DefaultTask { if(extension.removeVolumes) { args += ['--volumes'] } + if (extension.removeOrphans()) { + args += '--remove-orphans' + } project.exec { ExecSpec e -> extension.setExecSpecWorkingDirectory(e) e.environment = extension.environment