Code Monkey home page Code Monkey logo

dev-container-features-template's Introduction

๐Ÿ‘‹ This repo is archived and kept here for historical reference only.

For all current work related to 'dev container features', please check out https://containers.dev or the dev container specification repo.


Development container features Template

To create your own remote dev container features, use this repo as a template. This repo contains two example "features" called helloworld and color.

These features can then be declared in your devcontainer.json file for use in the Remote-Containers extension or GitHub Codespaces.

Features In This Repo (Directory)

helloworld

This is a sample feature that prints the greeting option you pass to it when invoking the hello program in a terminal.

color

Prints your favorite color (in that color) when you run the program color in your terminal.

Note: Your favorite color can only be green, red, or gold.

Release Flow

Push a tag (eg v0.0.1) to your repo, which will trigger the deploy-features action in this repo's deploy-features.yml workflow file.

Assets will be compressed and added as a release artifact with the name devcontainer-features.tgz.

Include these features in your project's devcontainer

To include your feature in a project's devcontainer, provide the following features like so.

"image": "mcr.microsoft.com/vscode/devcontainers/base",
features: {
    "<OWNER>/<REPO>/helloworld": {
        "greeting": "Hello!"
    },
    "<OWNER>/<REPO>/color": {
        "color": "green" 
    }
}
  • Where OWNER is the repo owner (for this template, microsoft).
  • Where REPO is the repo name (for this template, dev-container-features-template)

Providing no version implies the latest release's artifacts. To supply a tag as a version, use the following notation.

features: {
    "<OWNER>/<REPO>/[email protected]": {
        greeting: "Hello!"
    }
}

Adding your own features

This functionality is in Preview (and subject to change!) Please give it a try, and provide feedback along the way.

To add your own features to this template, follow these steps:

  1. Customize the 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. Further documentation will be forthcoming as this functionality moves out of preview!

  2. The install.sh script is the entrypoint that the Remote-Containers extension, the devcontainer-cli, and Codespaces will use to install your features.

If a feature is declared in your devcontainer.json, the _BUILD_ARG_<FEATURE_NAME> will be set to true. If you supply any options, those are exposed as _BUILD_ARG_<FEATURE_NAME>_<OPTION_NAME>.

Always source ./devcontainer-features.env 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).


Contributing

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.

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.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

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.

dev-container-features-template's People

Contributors

chuxel avatar joshspicer avatar microsoftopensource avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dev-container-features-template's Issues

NOTICE: Name change `features.*` --> `devcontainer-features.*`

A recent breaking change was introduced to our preview for dev container features.

Everywhere a file had been called features.{tgz, json} is now named devcontainer-features.{tgz, json}.

Codespaces and Remote-Containers has now been updated to expect these names, and the previous names will cause a build error.

Steps to update:

  1. Update this line in your local copy of the template to emit the release artifact with the new name
  2. Re-release your features on a new tag

Please note that any older releases prior to this change will no longer work.

Thanks for experimenting and bearing with us during the feature preview. If you have any further feedback, PLEASE let us know over at the dev-container-spec repo.

Context: microsoft/vscode-remote-release#5980

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.