├── .github └── workflows │ └── deploy-features.yml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── devcontainer-features.json └── install.sh /.github/workflows/deploy-features.yml: -------------------------------------------------------------------------------- 1 | name: 'Deploy Features' 2 | on: 3 | push: 4 | tags: 5 | - 'v*' 6 | 7 | jobs: 8 | deploy: # make sure the action works on a clean machine without building 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | 13 | - name: Get tag name 14 | id: get_tag_name 15 | run: echo "::set-output name=tag::$(echo "${{ github.ref }}" | grep -oP 'refs/tags/\K(.+)')" 16 | 17 | - name: Publish dev container features 18 | uses: microsoft/publish-dev-container-features-action@main 19 | with: 20 | path-to-features: '.' 21 | 22 | - name: Get or Create Release at current tag 23 | uses: ncipollo/release-action@v1 24 | with: 25 | allowUpdates: true # Lets us upload our own artifact from previous step 26 | artifactErrorsFailBuild: true 27 | artifacts: './devcontainer-features.tgz' 28 | token: ${{ secrets.GITHUB_TOKEN }} 29 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > 👋 This repo is **archived** and kept here for historical reference only. 2 | > 3 | > For all current work related to 'dev container features', please check out [https://containers.dev](https://containers.dev) or the [dev container specification repo](https://github.com/devcontainers/spec). 4 | 5 | ------- 6 | 7 | # Development container `features` Template 8 | 9 | To create your own remote [**dev container features**](https://code.visualstudio.com/docs/remote/containers#_dev-container-features-preview), use this repo as a template. This repo contains two example "features" called `helloworld` and `color`. 10 | 11 | These features can then be declared in your `devcontainer.json` file for use in the Remote-Containers extension or GitHub Codespaces. 12 | 13 | 14 | # Features In This Repo (Directory) 15 | 16 | ### helloworld 17 | 18 | This is a sample feature that prints the greeting option you pass to it when invoking the `hello` program in a terminal. 19 | 20 | ### color 21 | 22 | Prints your favorite color (in that color) when you run the program `color` in your terminal. 23 | 24 | Note: Your favorite color can only be `green`, `red`, or `gold`. 25 | 26 | ## Release Flow 27 | 28 | Push a tag (eg `v0.0.1`) to your repo, which will trigger the [deploy-features action](https://github.com/microsoft/publish-dev-container-features-action) in this repo's [`deploy-features.yml` workflow file](https://github.com/microsoft/dev-container-features-template/blob/main/.github/workflows/deploy-features.yml). 29 | 30 | Assets will be compressed and added as a release artifact with the name `devcontainer-features.tgz`. 31 | 32 | ## Include these features in your project's devcontainer 33 | 34 | To include your feature in a project's devcontainer, provide the following `features` like so. 35 | 36 | ```jsonc 37 | "image": "mcr.microsoft.com/vscode/devcontainers/base", 38 | features: { 39 | "//helloworld": { 40 | "greeting": "Hello!" 41 | }, 42 | "//color": { 43 | "color": "green" 44 | } 45 | } 46 | ``` 47 | 48 | - Where OWNER is the repo owner (for this template, `microsoft`). 49 | - Where REPO is the repo name (for this template, `dev-container-features-template`) 50 | 51 | Providing no version implies the latest release's artifacts. To supply a tag as a version, use the following notation. 52 | 53 | ```jsonc 54 | features: { 55 | "//helloworld@v0.0.1": { 56 | greeting: "Hello!" 57 | } 58 | } 59 | ``` 60 | 61 | ## Adding your own features 62 | 63 | > This functionality is in Preview (and subject to change!) Please give it a try, and provide [feedback](https://github.com/microsoft/dev-container-spec) along the way. 64 | 65 | To add your own features to this template, follow these steps: 66 | 67 | 1. Customize the [`devcontainer-features.json`](https://github.com/microsoft/dev-container-features-template/blob/main/devcontainer-features.json), adding in another `feature` object to the array. For an idea of what attributes can be provided in this preview, check out the [features definition on vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/container-features/src/devcontainer-features.json). _Further documentation will be forthcoming as this functionality moves out of preview!_ 68 | 69 | 2. The [`install.sh`](https://github.com/microsoft/dev-container-features-template/blob/main/install.sh) script is the entrypoint that the Remote-Containers extension, the devcontainer-cli, and Codespaces will use to install your features. 70 | 71 | If a feature is declared in your `devcontainer.json`, the `_BUILD_ARG_` will be set to `true`. If you supply any options, those are exposed as `_BUILD_ARG__`. 72 | 73 | Always source [`./devcontainer-features.env`](https://github.com/microsoft/dev-container-features-template/blob/main/install.sh#L9-L11) at the top of your install.sh script, that's the file the tooling will write all the environment variables to, and is useful for the author (you!) to use in your install script(s). 74 | 75 | ------ 76 | 77 | ## Contributing 78 | 79 | This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 80 | 81 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. 82 | 83 | This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. 84 | 85 | ## Trademarks 86 | 87 | This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. 88 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # TODO: The maintainer of this repo has not yet edited this file 2 | 3 | **REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? 4 | 5 | - **No CSS support:** Fill out this template with information about how to file issues and get help. 6 | - **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). 7 | - **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. 8 | 9 | *Then remove this first heading from this SUPPORT.MD file before publishing your repo.* 10 | 11 | # Support 12 | 13 | ## How to file issues and get help 14 | 15 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 16 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 17 | feature request as a new Issue. 18 | 19 | For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE 20 | FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER 21 | CHANNEL. WHERE WILL YOU HELP PEOPLE?**. 22 | 23 | ## Microsoft Support Policy 24 | 25 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above. 26 | -------------------------------------------------------------------------------- /devcontainer-features.json: -------------------------------------------------------------------------------- 1 | { 2 | "features": [ 3 | { 4 | "id": "helloworld", 5 | "name": "My First Feature", 6 | "options": { 7 | "greeting": { 8 | "type": "string", 9 | "proposals": [ "hey", "hello", "hi", "howdy" ], 10 | "default": "hey", 11 | "description": "Select a pre-made greeting, or enter your own" 12 | } 13 | }, 14 | "include": ["ubuntu"] 15 | }, 16 | { 17 | "id": "color", 18 | "name": "A feature to remind you of your favorite color", 19 | "options": { 20 | "favorite": { 21 | "type": "string", 22 | "enum": [ "red", "gold", "green" ], 23 | "default": "red", 24 | "description": "Choose your favorite color." 25 | } 26 | }, 27 | "include": ["ubuntu"] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # The install.sh script is the installation entrypoint for any dev container 'features' in this repository. 5 | # 6 | # The tooling will parse the devcontainer-features.json + user devcontainer, and write 7 | # any build-time arguments into a feature-set scoped "devcontainer-features.env" 8 | # The author is free to source that file and use it however they would like. 9 | set -a 10 | . ./devcontainer-features.env 11 | set +a 12 | 13 | 14 | if [ ! -z ${_BUILD_ARG_HELLOWORLD} ]; then 15 | echo "Activating feature 'helloworld'" 16 | 17 | # Build args are exposed to this entire feature set following the pattern: _BUILD_ARG__