diff --git a/README.md b/README.md index aa3f4652db..6704fbca54 100644 --- a/README.md +++ b/README.md @@ -44,23 +44,13 @@ Beyond the advantages of having your team use a consistent environment and tool- Absolutely! If you want to use an existing Dockerfile as a starting point, run **Remote-Containers: Create Container Configuration File...** from the command pallette (Cmd/Ctrl+Shift+P). You'll be prompted to select a Dockerfile or you can opt to use a base image instead and customize from there. -You can also check out the [existing Dockerfile](containers/docker-existing-dockerfile) and [existing Docker Compose](containers/docker-existing-docker-compose) definitions for an example. You can also [attach to an already running container](https://aka.ms/vscode-remote/containers/attach) if you'd prefer. +You can also check out the [existing Dockerfile](containers/docker-existing-dockerfile) and [existing Docker Compose](containers/docker-existing-docker-compose) definitions for an example `devcontainer.json` . If none of these options meet your needs, you can start up the container any way you see fit and [attach to it](https://aka.ms/vscode-remote/containers/attach) instead. ### What is the goal of `devcontainer.json`? The intent of `devcontainer.json` is conceptually similar to VS Code's `launch.json` for debugging, but designed to launch (or attach to) your development container instead. At its simplest, all you need to do is add a `.devcontainer/devcontainer.json` file to your project and reference an image, `Dockerfile`, or `docker-compose.yml` and a few properties. -Check out the `container-templates` folder for simple examples. The definitions in the `containers` folder can be used as-is or as samples for how to modify your existing config to support different scenarios. From there, you can [alter your configuration](https://aka.ms/vscode-remote/containers/folder-setup) to install additional tools like Git in the container, automatically install other extensions, expose additional ports, set runtime arguments, and more. - -### Are development containers intended to define how an application is deployed? - -No. A development container is an environment that you can use to develop your application even before you are ready to build or deploy. While deployment and development containers may resemble one another, you often will not include tools in a deployment image that you will want during development. The set of "dev container definitions" found in the [vscode-dev-containers repo](https://aka.ms/vscode-dev-containers) are intended to help jump start the process of creating a development container by including a set of well-known container build or deployment files and a `devcontainer.json` file. This file provides a home for tooling and edit-time related settings and a pointer to the image (or files that define the image) that should be used for the development container. However, their use is entirely optional, and you can [attach to a running container](https://aka.ms/vscode-remote/attach) in other container-based workflows and scenarios. - -### Are development containers intended to define how an application is built? Like Buildpacks? - -No. The [Buildpack](https://buildpacks.io/) concept focuses on taking source code and generating deployable container images through a series of defined steps. A dev container is an environment you can use to develop your application even before you are ready to build. They are therefore complementary concepts. The `devcontainer.json` file is not intended to define how your application should be built, but rather provides a home for tooling and edit-time related settings and a pointer to an image or image definition files. Today it supports pointing to an existing image (which could be generated by a Buildpack), a Dockerfile, or one or more `docker-compose.yml` files, but more will be added as the community has interest. You can also opt to [attach to a running container](https://aka.ms/vscode-remote/attach) if you prefer to use an alternate container build or deployment workflow. - -Similarly, the "dev container definitions" found in the [vscode-dev-containers repo](https://aka.ms/vscode-dev-containers) can help jump start the process of creating a dev container when you do not have an existing image, `Dockerfile`, or `docker-compose.yml`. These can also act as samples if you do have existing container files. However, they are not intended to define how an application should be built. +Check out the `container-templates` folder for simple starter templates. The definitions in the `containers` folder can be used as-is or as samples for how to modify your existing config to support different scenarios. From there, you can [alter your configuration](https://aka.ms/vscode-remote/containers/folder-setup) to install additional tools like Git in the container, automatically install other extensions, expose additional ports, set runtime arguments, and more. ## Contributing & Feedback diff --git a/container-templates/docker-compose/.devcontainer/devcontainer.json b/container-templates/docker-compose/.devcontainer/devcontainer.json index c434d9100d..ceb9c8d485 100644 --- a/container-templates/docker-compose/.devcontainer/devcontainer.json +++ b/container-templates/docker-compose/.devcontainer/devcontainer.json @@ -3,6 +3,7 @@ "dockerComposeFile": ".devcontainer/docker-compose.yml", "service": "your-service-name-here", "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", "extensions": [ "mutantdino.resourcemonitor" ] diff --git a/containers/docker-in-docker-compose/.devcontainer/devcontainer.json b/containers/docker-in-docker-compose/.devcontainer/devcontainer.json index e18f327882..e02a6091ba 100644 --- a/containers/docker-in-docker-compose/.devcontainer/devcontainer.json +++ b/containers/docker-in-docker-compose/.devcontainer/devcontainer.json @@ -3,6 +3,7 @@ "dockerComposeFile": ".devcontainer/docker-compose.yml", "service": "docker-in-docker", "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", "extensions": [ "peterjausovec.vscode-docker" ] diff --git a/containers/javascript-node-8-mongo/.devcontainer/devcontainer.json b/containers/javascript-node-8-mongo/.devcontainer/devcontainer.json index b1c22f3121..1576eec67c 100644 --- a/containers/javascript-node-8-mongo/.devcontainer/devcontainer.json +++ b/containers/javascript-node-8-mongo/.devcontainer/devcontainer.json @@ -3,6 +3,7 @@ "dockerComposeFile": ".devcontainer/docker-compose.yml", "service": "web", "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", "extensions": [ "dbaeumer.vscode-eslint" ] diff --git a/containers/python-3-flask-redis/.devcontainer/devcontainer.json b/containers/python-3-flask-redis/.devcontainer/devcontainer.json index c5b4ab1f76..15adbf6190 100644 --- a/containers/python-3-flask-redis/.devcontainer/devcontainer.json +++ b/containers/python-3-flask-redis/.devcontainer/devcontainer.json @@ -3,6 +3,7 @@ "dockerComposeFile": ".devcontainer/docker-compose.yml", "service": "web", "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", "extensions": [ "ms-python.python", "LittleFoxTeam.vscode-python-test-adapter" diff --git a/containers/python-3-jupyter-pyspark/.devcontainer/devcontainer.json b/containers/python-3-jupyter-pyspark/.devcontainer/devcontainer.json index cd54f86f73..00d2d782f1 100644 --- a/containers/python-3-jupyter-pyspark/.devcontainer/devcontainer.json +++ b/containers/python-3-jupyter-pyspark/.devcontainer/devcontainer.json @@ -3,6 +3,7 @@ "dockerComposeFile": ".devcontainer/docker-compose.yml", "service": "jupyter", "workspaceFolder": "/notebooks", + "shutdownAction": "stopCompose", "extensions": [ "ms-python.python" ]