A collection of Dev Container Features managed by Dev Container spec maintainers. See https://github.com/devcontainers/feature-starter to publish your own
Find a file
Philipp Wagner def3a41f57
Fix common-utils installation on RHEL (and friends) (#772)
* Fix indentation in common-utils/main.sh

* common-utils: Fix install error on RHEL

On RHEL (and derivatives) the installation of the common-utils feature
could fail if the feature ran before (i.e., `PACKAGES_ALREADY_INSTALLED`
is set) and if either `INSTALL_ZSH` is false, or zsh was installed
earlier and `ZSH_ALREADY_INSTALLED` is true.

In these cases the script the `package_list` is empty, and `dnf`
terminates with the following error message:

```
usage: dnf install [-c [config file]] [-q] [-v] [--version]
                   [--installroot [path]] [--nodocs] [--noplugins]
                   [--enableplugin [plugin]] [--disableplugin [plugin]]
                   [--releasever RELEASEVER] [--setopt SETOPTS]
                   [--skip-broken] [-h] [--allowerasing] [-b | --nobest] [-C]
                   [-R [minutes]] [-d [debug level]] [--debugsolver]
                   [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                   [--rpmverbosity [debug level name]] [-y] [--assumeno]
                   [--enablerepo [repo]] [--disablerepo [repo] | --repo
                   [repo]] [--enable | --disable] [-x [package]]
                   [--disableexcludes [repo]] [--repofrompath [repo,path]]
                   [--noautoremove] [--nogpgcheck] [--color COLOR] [--refresh]
                   [-4] [-6] [--destdir DESTDIR] [--downloadonly]
                   [--comment COMMENT] [--bugfix] [--enhancement]
                   [--newpackage] [--security] [--advisory ADVISORY]
                   [--bz BUGZILLA] [--cve CVES]
                   [--sec-severity {Critical,Important,Moderate,Low}]
                   [--forcearch ARCH]
                   PACKAGE [PACKAGE ...]
dnf install: error: the following arguments are required: PACKAGE
```

Fix the problem by running `dnf` only with a non-zero `package_list`.
2023-12-05 17:02:58 -08:00
.devcontainer Update Features - Remove use of get_common_setting (#735) 2023-10-27 15:47:44 -07:00
.github/workflows Bump the dotnet version after a script update (#707) 2023-09-28 10:50:20 -07:00
.vscode Update launch.json 2022-05-12 20:49:10 -04:00
src Fix common-utils installation on RHEL (and friends) (#772) 2023-12-05 17:02:58 -08:00
test [common-utils] Bug fix: zsh missing rc snippet (#736) 2023-10-27 15:47:26 -07:00
.gitignore add v2 action 2022-06-03 14:49:26 +00:00
CODEOWNERS Adds CODEOWNER (#69) 2022-07-27 21:31:23 +00:00
CONTRIBUTING.md Add contributing document (#488) 2023-03-23 16:07:08 -07:00
LICENSE Create LICENSE (#54) 2022-06-29 12:59:43 -04:00
README.md Add contributing document (#488) 2023-03-23 16:07:08 -07:00

Development Container Features

devcontainers organization logo Development Container 'Features'
A set of simple and reusable Features. Quickly add a language/tool/CLI to a development container.

'Features' are self-contained units of installation code and development container configuration. Features are designed to install atop a wide-range of base container images.

Missing a CLI or language in your otherwise perfect container image? Add the relevant Feature to the features property of a devcontainer.json. A tool supporting the dev container specification is required to build a development container.

You may learn about Features at containers.dev, which is the website for the dev container specification.

Usage

To reference a Feature from this repository, add the desired Features to a devcontainer.json. Each Feature has a README.md that shows how to reference the Feature and which options are available for that Feature.

The example below installs the go and docker-in-docker declared in the ./src directory of this repository.

See the relevant Feature's README for supported options.

"name": "my-project-devcontainer",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",  // Any generic, debian-based image.
"features": {
    "ghcr.io/devcontainers/features/go:1": {
        "version": "1.18"
    },
    "ghcr.io/devcontainers/features/docker-in-docker:1": {
        "version": "latest",
        "moby": true
    }
}

The :latest version annotation is added implicitly if omitted. To pin to a specific package version (example), append it to the end of the Feature. Features follow semantic versioning conventions, so you can pin to a major version :1, minor version :1.0, or patch version :1.0.0 by specifying the appropriate label.

"features": {
    "ghcr.io/devcontainers/features/go:1.0.0": {
        "version": "1.18"
    }
}

The devcontainer CLI reference implementation (or a supporting tool) can be used to build a project's dev container declaring Features.

git clone <my-project-with-devcontainer>
devcontainer build --workspace-folder <path-to-my-project-with-devcontainer>

Repo Structure

.
├── README.md
├── src
│   ├── dotnet
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
│   ├── go
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
|   ├── ...
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
├── test
│   ├── dotnet
│   │   └── test.sh
│   ├── go
|   |   ├── scenarios.json
|   |   ├── test_scenario_1.json
│   |   └── test.sh
|   ├── ...
│   │   └── test.sh
...
  • src - A collection of subfolders, each declaring a Feature. Each subfolder contains at least a devcontainer-feature.json and an install.sh script.
  • test - Mirroring src, a folder-per-feature with at least a test.sh script. The devcontainer CLI will execute these tests in CI.

Contributions

Creating your own collection of Features

The Feature distribution specification outlines a pattern for community members and organizations to self-author Features in repositories they control.

A template repo devcontainers/feature-template and GitHub Action are available to help bootstrap self-authored Features.

We are eager to hear your feedback on self-authoring! Please provide comments and feedback on spec issue #70.

Contributing to this repository

This repository will accept improvement and bug fix contributions related to the current set of maintained Features.

🤝 You can read more about how to contribute in CONTRIBUTING.md. ❤️