From 0be65aaa9ac989489b9133ce6d921ffb914e7e8f Mon Sep 17 00:00:00 2001 From: Chris Dias Date: Sun, 28 Jan 2018 19:49:18 -0800 Subject: [PATCH] fixes #200 --- commands/docker-compose.ts | 6 +++++- package.json | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/commands/docker-compose.ts b/commands/docker-compose.ts index 438c7c035c..a24898e3a2 100644 --- a/commands/docker-compose.ts +++ b/commands/docker-compose.ts @@ -65,7 +65,11 @@ async function compose(command: string, message: string, dockerComposeFileUri?: if (selectedItem) { const terminal: vscode.Terminal = vscode.window.createTerminal('Docker Compose'); - terminal.sendText(command.toLowerCase() === 'up' ? `docker-compose -f ${selectedItem.file} ${command} -d --build` : `docker-compose -f ${selectedItem.file} ${command}`); + const configOptions: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('docker'); + const build: string = configOptions.get('dockerComposeBuild', true) ? '--build': ''; + const detached: string = configOptions.get('dockerComposeDetached', true) ? '-d' : ''; + + terminal.sendText(command.toLowerCase() === 'up' ? `docker-compose -f ${selectedItem.file} ${command} ${detached} ${build}` : `docker-compose -f ${selectedItem.file} ${command}`); terminal.show(); if (reporter) { /* __GDPR__ diff --git a/package.json b/package.json index c652032230..694e865a19 100644 --- a/package.json +++ b/package.json @@ -434,6 +434,16 @@ "type": "boolean", "default": false, "description": "Prompt for confirmation when running System Prune command" + }, + "docker.dockerComposeBuild": { + "type": "boolean", + "default": true, + "description": "Run docker-compose with the --build argument, defaults to true" + }, + "docker.dockerComposeDetached": { + "type": "boolean", + "default": true, + "description": "Run docker-compose with the --d (detached) argument, defaults to true" } } },