From 1fa3e3d86488d0a6e1f3d54545f2648ba2bbd553 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Fri, 29 Mar 2019 16:51:02 -0700 Subject: [PATCH] Updated compose example assuming support of array of compose files --- .../.devcontainer/docker-compose.yml | 2 +- .../.devcontainer/docker-compose.yml | 12 +++--------- .../.vscode/devContainer.json | 14 +++++++++----- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/container-templates/docker-compose/.devcontainer/docker-compose.yml b/container-templates/docker-compose/.devcontainer/docker-compose.yml index cef03ab193..4ca515da68 100644 --- a/container-templates/docker-compose/.devcontainer/docker-compose.yml +++ b/container-templates/docker-compose/.devcontainer/docker-compose.yml @@ -8,7 +8,7 @@ services: your-service-name-here: build: context: . - dockerfile: Dockerfile # Using a Dockerfile is optional, but included for completeness. + dockerfile: .devcontainer/Dockerfile # Using a Dockerfile is optional, but included for completeness. ports: - "3000:3000" # Application port to forward diff --git a/containers/docker-existing-docker-compose/.devcontainer/docker-compose.yml b/containers/docker-existing-docker-compose/.devcontainer/docker-compose.yml index 043b83d039..79997ed202 100644 --- a/containers/docker-existing-docker-compose/.devcontainer/docker-compose.yml +++ b/containers/docker-existing-docker-compose/.devcontainer/docker-compose.yml @@ -3,16 +3,10 @@ # Licensed under the MIT License. See LICENSE in the project root for license information. #----------------------------------------------------------------------------------------- -version: '2.1' +version: '3' services: - devcontainer: - extends: - # Update this to the name of the service you want to work with in your docker-compose.yml file - service: your-service-name-here - - # Update this if you have Docker Compose file with a different name - file: docker-compose.yml - + # Update this to the name of the service you want to work with in your docker-compose.yml file + your-service-name-here: volumes: # Update this to wherever you want VS Code to mount the folder of your project - .:/workspace diff --git a/containers/docker-existing-docker-compose/.vscode/devContainer.json b/containers/docker-existing-docker-compose/.vscode/devContainer.json index 95b69dd936..d20c9f154f 100644 --- a/containers/docker-existing-docker-compose/.vscode/devContainer.json +++ b/containers/docker-existing-docker-compose/.vscode/devContainer.json @@ -1,12 +1,16 @@ { "name": "Existing Docker Compose", - "// Most of the configuration is in this .devcontainer/docker-compose.yml file":"", - "dockerComposeFile": ".devcontainer/docker-compose.yml", + "// Update this list if you have more compose files or use different names. The": "", + "// .devcontainer/docker-compose.yml file contains any overrides you need/want to make.":"", + "dockerComposeFile": [ + "docker-compose.yml", + ".devcontainer/docker-compose.yml" + ], - "// The service property is the name of the service that extends your existing service": "", - "// in .devcontainer/docker-compose.yml. Update the real service name and file path there.":"", - "service": "devcontainer", + "// The service property is the name of the service for the container that VS Code should": "", + "// use. Update this value and .devcontainer/docker-compose.yml to the real service name.":"", + "service": "your-service-name-here", "// The volume property is the path VS Code should open by default when connected to the service.": "", "// This is typically a file mount in .devcontainer/docker-compose.yml":"",