Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Small edits, added shutdownAction for compose definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Apr 11, 2019
1 parent 2900575 commit 99ab06f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dockerComposeFile": ".devcontainer/docker-compose.yml",
"service": "your-service-name-here",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"extensions": [
"mutantdino.resourcemonitor"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dockerComposeFile": ".devcontainer/docker-compose.yml",
"service": "docker-in-docker",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"extensions": [
"peterjausovec.vscode-docker"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dockerComposeFile": ".devcontainer/docker-compose.yml",
"service": "web",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"extensions": [
"dbaeumer.vscode-eslint"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dockerComposeFile": ".devcontainer/docker-compose.yml",
"service": "web",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"extensions": [
"ms-python.python",
"LittleFoxTeam.vscode-python-test-adapter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dockerComposeFile": ".devcontainer/docker-compose.yml",
"service": "jupyter",
"workspaceFolder": "/notebooks",
"shutdownAction": "stopCompose",
"extensions": [
"ms-python.python"
]
Expand Down

0 comments on commit 99ab06f

Please sign in to comment.