This repository hosts multiple Dev Container Features for various development tools and services.
.
├─ src/
│ ├─ confluent-cli/
│ │ ├─ devcontainer-feature.json
│ │ ├─ install.sh
│ │ └─ README.md
│ ├─ confluent-platform/
│ │ ├─ devcontainer-feature.json
│ │ ├─ install.sh
│ │ └─ README.md
│ ├─ nats/
│ │ ├─ devcontainer-feature.json
│ │ ├─ install.sh
│ │ ├─ library_scripts.sh
│ │ └─ README.md
│ └─ ... (other features)
├─ .devcontainer/
│ └─ devcontainer.json (example usage)
├─ LICENSE
└─ README.md (this file)
-
confluent-cli- Installs the Confluent CLI binary from GitHub Releases.
- User-configurable options:
version: The release tag to download (e.g.3.24.1, orlatest).installPath: Directory to place theconfluentbinary (default/usr/local/bin).
-
confluent-platform- Installs the full Confluent Platform (Kafka, Schema Registry, Connect, etc.) from the Confluent tarball.
- User-configurable options:
version: The Confluent Platform version (e.g.7.4.0).installPath: Where the platform is extracted (default/usr/local/confluent).
-
nats- Installs NATS server and CLI from GitHub Releases with configurable authentication and service management.
- User-configurable options:
serverVersion: NATS server version (e.g.2.11.5, orlatest).cliVersion: NATS CLI version (e.g.0.2.3, orlatest).auth: Authentication method (none,token,user-password,nkey).jetstream: Enable JetStream persistent messaging (defaulttrue).autoStart: Automatically start NATS server (defaulttrue).
If you want to use these features in a local Dev Container without publishing them:
-
Clone or copy this repository into your project, ensuring the
src/directory structure is preserved. -
In your project’s
.devcontainer/devcontainer.json, reference the features insrc/via relative paths.
For example, if your structure looks like this:your-project/ ├─ .devcontainer/ │ └─ devcontainer.json └─ my-devcontainer-features/ └─ src/ ├─ confluent-cli/ └─ confluent-platform/Your
.devcontainer/devcontainer.jsonmight reference them like so: -
Rebuild your Dev Container in VS Code (or another Dev Container environment).
-
Verify installation inside the container:
- Confluent CLI:
confluent --version - Confluent Platform: Check
kafka-server-startor contents in/usr/local/confluent(if you used the default install path).
- Confluent CLI:
If you publish these features to GHCR or another registry, you can reference them directly by their namespace, for example:
{
"features": {
"ghcr.io/tsok-dev/devcontainer-features/confluent-cli:1.0.0": {
"version": "3.24.1",
"installPath": "/usr/local/bin"
},
"ghcr.io/tsok-dev/devcontainer-features/confluent-platform:1.0.0": {
"version": "7.4.0",
"installPath": "/usr/local/confluent"
}
}
}- Run
confluent --versionin the container’s terminal to confirm the CLI is installed.
- Files will be located at
installPath(e.g.,/usr/local/confluent). - Start a service (e.g. Kafka) by running:
$INSTALL_PATH/bin/kafka-server-start \ $INSTALL_PATH/etc/kafka/server.properties
We welcome contributions and issues. Feel free to open a PR or file an issue:
Include your chosen license (e.g. MIT License) in a LICENSE file at the root of this repo.
{ "name": "Dev Container with Confluent and NATS", "features": { // Confluent CLI feature (path to src/confluent-cli) "../my-devcontainer-features/src/confluent-cli": { "version": "latest", "installPath": "/usr/local/bin" }, // Confluent Platform feature (path to src/confluent-platform) "../my-devcontainer-features/src/confluent-platform": { "version": "7.4.0", "installPath": "/usr/local/confluent" }, // NATS feature (path to src/nats) "../my-devcontainer-features/src/nats": { "serverVersion": "latest", "cliVersion": "latest", "auth": "user-password", "username": "admin", "password": "secure-password", "jetstream": true } } }