Skip to content

This repository contains a collection of dev container Features hosted on the GitHub Container Registry.

License

Notifications You must be signed in to change notification settings

hwaien/devcontainer-features

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dev Container Features

This repository contains a collection of dev container Features, hosted on the GitHub Container Registry. The Features in this repository follow the dev container Feature distribution specification.

Contents

This repository contains a collection of Feature implementations. Each sub-section below shows a sample devcontainer.json usage.

git-remote-gcrypt

Encrypt/decrypt Git remotes with GnuPG.

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/hwaien/devcontainer-features/git-remote-gcrypt": {}
  }
}

hyas-cli

A tool to help create and maintain Hugo websites.

{
  "image": "mcr.microsoft.com/devcontainers/typescript-node",
  "features": {
    "ghcr.io/hwaien/devcontainer-features/hyas-cli": {}
  }
}

match-host-time-zone

The built container will match the host's time zone.

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/hwaien/devcontainer-features/match-host-time-zone": {}
  }
}

ssh-keygen

An SSH key is generated for the built container.

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/hwaien/devcontainer-features/ssh-keygen": {}
  }
}

Repo Structure

Similar to the devcontainers/features repo, this repository has a src folder. Each Feature has its own sub-folder, containing at least a devcontainer-feature.json and an entrypoint script install.sh.

├── src
│   ├── match-host-time-zone
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
|   ├── ...
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
...

An implementing tool will composite the documented dev container properties from the feature's devcontainer-feature.json file, and execute in the install.sh entrypoint script in the container during build time. Implementing tools are also free to process attributes under the customizations property as desired.

Distributing Features

Versioning

Features are individually versioned by the version attribute in a Feature's devcontainer-feature.json. Features are versioned according to the semver specification. More details can be found in the dev container Feature specification.

Publishing

This repo contains a GitHub Action workflow that will publish each feature to GHCR. By default, each Feature will be prefixed with the <owner>/<repo> namespace. For example, the match-host-time-zone Feature in this repository can be referenced in a devcontainer.json with:

ghcr.io/hwaien/devcontainer-features/match-host-time-zone:1

The provided GitHub Action will also publish a third "metadata" package with just the namespace, eg: ghcr.io/hwaien/devcontainer-features. This contains information useful for tools aiding in Feature discovery.

'hwaien/devcontainer-features' is known as the feature collection namespace.

Marking Feature Public

Note that by default, GHCR packages are marked as private. To stay within the free tier, Features need to be marked as public.

This can be done by navigating to the Feature's "package settings" page in GHCR, and setting the visibility to 'public`.

Adding Features to the Index

For Features to appear in the public index so that other community members can find them, you can do the following:

This index is from where supporting tools like VS Code Dev Containers and GitHub Codespaces surface Features for their dev container creation UI.

About

This repository contains a collection of dev container Features hosted on the GitHub Container Registry.

Resources

License

Stars

Watchers

Forks