Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ Applying a template writes a `.devcontainer/devcontainer.json` into your project
"source": "${devcontainerId}-uv-cache",
"target": "/home/dev/.cache/uv",
"type": "volume"
},
{
"source": "${devcontainerId}-bash-history",
"target": "/home/dev/.local/state/bash",
"type": "volume"
}
],
"customizations": {
Expand All @@ -83,7 +88,7 @@ Each part maps to one of the goals above:

- `image` references a base image from [Bare Dev Container Images], a separate repository that builds minimal images with pinned digests, SLSA provenance, and an SPDX SBOM. This repository ships configuration only; what is installed inside the container is documented there.
- `remoteUser`, `runArgs`, `securityOpt`, and `init` are the shared hardening defaults, applied identically by every template.
- `mounts` persists the toolchain's cache directories in named volumes, so rebuilding to pick up an image update doesn't re-download dependencies.
- `mounts` persists the toolchain's cache directories in named volumes, so rebuilding to pick up an image update doesn't re-download dependencies. A further volume holds the bash history the image writes, so a rebuild doesn't clear it.
- `customizations` pairs the toolchain with the relevant extensions and settings, so the editor is ready to use on first open.

The generated file is yours to edit — it is a plain dev container configuration, so you can layer [Features](https://containers.dev/features), add mounts, or relax any of the defaults.
Expand Down
6 changes: 6 additions & 0 deletions src/bun/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"source": "${devcontainerId}-bun-install-cache",
"target": "/home/dev/.bun/install/cache",
"type": "volume"
},
// Persist the shell history the image keeps in this directory.
{
"source": "${devcontainerId}-bash-history",
"target": "/home/dev/.local/state/bash",
"type": "volume"
}
],
"customizations": {
Expand Down
5 changes: 4 additions & 1 deletion src/bun/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

Bun's global install cache is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading packages:
Bun's global install cache is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading packages. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-bun-install-cache` | `/home/dev/.bun/install/cache` | Bun's global install cache |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Editor Integration

Expand Down
5 changes: 4 additions & 1 deletion src/bun/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

Bun's global install cache is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading packages:
Bun's global install cache is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading packages. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-bun-install-cache` | `/home/dev/.bun/install/cache` | Bun's global install cache |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Editor Integration

Expand Down
2 changes: 1 addition & 1 deletion src/bun/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "bun",
"version": "1.0.8",
"version": "1.1.0",
"name": "Bun",
"description": "Security-focused Bun dev container for JS/TS with hardened defaults and cached installs.",
"publisher": "Bare Dev Container Maintainers",
Expand Down
12 changes: 10 additions & 2 deletions src/debian/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@
"runArgs": ["--cap-drop=ALL"],
// Remove "no-new-privileges" if users need to gain elevated privileges inside the container (e.g., su, sudo).
"securityOpt": ["no-new-privileges"],
"init": true
"init": true,
// If you use VS Code, uncomment the following to open $EDITOR/$VISUAL/$GIT_EDITOR (e.g. `git commit`) in a VS Code tab:
// "remoteEnv": {
// "VISUAL": "code --wait",
// "EDITOR": "code --wait",
// "GIT_EDITOR": "code --wait"
// }
// },
"mounts": [
// Persist the shell history the image keeps in this directory.
{
"source": "${devcontainerId}-bash-history",
"target": "/home/dev/.local/state/bash",
"type": "volume"
}
]
}
10 changes: 10 additions & 0 deletions src/debian/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ This template is a minimal Debian base for any development stack — no language
- extend the image with your own `Dockerfile`, or
- switch to a stack-specific Bare Dev Container template (Go, Rust, Node.js, ...).

## Persistent Caches

Bash history is persisted in a named volume, so rebuilding the container to pick up image updates doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Tips

- If you use VS Code, uncomment the `remoteEnv` block in `devcontainer.json` to open `$EDITOR`/`$VISUAL`/`$GIT_EDITOR` (e.g. `git commit`) in a VS Code tab.
10 changes: 10 additions & 0 deletions src/debian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ This template is a minimal Debian base for any development stack — no language
- extend the image with your own `Dockerfile`, or
- switch to a stack-specific Bare Dev Container template (Go, Rust, Node.js, ...).

## Persistent Caches

Bash history is persisted in a named volume, so rebuilding the container to pick up image updates doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Tips

- If you use VS Code, uncomment the `remoteEnv` block in `devcontainer.json` to open `$EDITOR`/`$VISUAL`/`$GIT_EDITOR` (e.g. `git commit`) in a VS Code tab.
Expand Down
2 changes: 1 addition & 1 deletion src/debian/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "debian",
"version": "1.2.7",
"version": "1.3.0",
"name": "Debian",
"description": "Security-focused minimal Debian base for any stack, with hardened, non-root defaults.",
"publisher": "Bare Dev Container Maintainers",
Expand Down
6 changes: 6 additions & 0 deletions src/deno/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"source": "${devcontainerId}-deno-cache",
"target": "/home/dev/.cache/deno",
"type": "volume"
},
// Persist the shell history the image keeps in this directory.
{
"source": "${devcontainerId}-bash-history",
"target": "/home/dev/.local/state/bash",
"type": "volume"
}
],
"customizations": {
Expand Down
5 changes: 4 additions & 1 deletion src/deno/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

Deno's cache directory (`DENO_DIR`) is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading remote modules or npm packages:
Deno's cache directory (`DENO_DIR`) is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading remote modules or npm packages. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-deno-cache` | `/home/dev/.cache/deno` | Deno's cache (`DENO_DIR`): remote modules and npm packages |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Editor Integration

Expand Down
5 changes: 4 additions & 1 deletion src/deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

Deno's cache directory (`DENO_DIR`) is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading remote modules or npm packages:
Deno's cache directory (`DENO_DIR`) is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading remote modules or npm packages. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-deno-cache` | `/home/dev/.cache/deno` | Deno's cache (`DENO_DIR`): remote modules and npm packages |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Editor Integration

Expand Down
2 changes: 1 addition & 1 deletion src/deno/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "deno",
"version": "1.0.3",
"version": "1.1.0",
"name": "Deno",
"description": "Security-focused Deno dev container for JS/TS with hardened defaults and cached modules.",
"publisher": "Bare Dev Container Maintainers",
Expand Down
6 changes: 6 additions & 0 deletions src/golang/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
"source": "${devcontainerId}-golang-build-cache",
"target": "/home/dev/.cache/go-build",
"type": "volume"
},
// Persist the shell history the image keeps in this directory.
{
"source": "${devcontainerId}-bash-history",
"target": "/home/dev/.local/state/bash",
"type": "volume"
}
],
"customizations": {
Expand Down
5 changes: 4 additions & 1 deletion src/golang/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

The Go module and build caches are persisted in named volumes, so rebuilding the container to pick up image updates doesn't require re-downloading modules or recompiling packages:
The Go module and build caches are persisted in named volumes, so rebuilding the container to pick up image updates doesn't require re-downloading modules or recompiling packages. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-golang-pkg-mod` | `/home/dev/go/pkg/mod` | Go module cache (`GOMODCACHE`) |
| `${devcontainerId}-golang-build-cache` | `/home/dev/.cache/go-build` | Go build cache (`GOCACHE`) |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Editor Integration

Expand Down
5 changes: 4 additions & 1 deletion src/golang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

The Go module and build caches are persisted in named volumes, so rebuilding the container to pick up image updates doesn't require re-downloading modules or recompiling packages:
The Go module and build caches are persisted in named volumes, so rebuilding the container to pick up image updates doesn't require re-downloading modules or recompiling packages. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-golang-pkg-mod` | `/home/dev/go/pkg/mod` | Go module cache (`GOMODCACHE`) |
| `${devcontainerId}-golang-build-cache` | `/home/dev/.cache/go-build` | Go build cache (`GOCACHE`) |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Editor Integration

Expand Down
2 changes: 1 addition & 1 deletion src/golang/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "golang",
"version": "1.3.1",
"version": "1.4.0",
"name": "Go",
"description": "Security-focused Go dev container with hardened defaults and rebuild-friendly caches.",
"publisher": "Bare Dev Container Maintainers",
Expand Down
6 changes: 6 additions & 0 deletions src/mise/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
"source": "${devcontainerId}-mise-cache",
"target": "/home/dev/.cache/mise",
"type": "volume"
},
// Persist the shell history the image keeps in this directory.
{
"source": "${devcontainerId}-bash-history",
"target": "/home/dev/.local/state/bash",
"type": "volume"
}
]
}
7 changes: 5 additions & 2 deletions src/mise/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See [Getting Started](https://github.com/bare-devcontainer/templates#getting-sta

## Image Variants

The `imageVariant` option selects the tag of the `ghcr.io/bare-devcontainer/mise` base image, which tracks the Debian release: `trixie` is Debian 13 and `bookworm` is Debian 12.
The `imageVariant` option selects the tag of the `ghcr.io/bare-devcontainer/mise` base image, which tracks the Debian release: `trixie` is Debian 13.

The values offered when applying the template are proposals, not a closed list — any published tag can be entered, including narrower ones such as a mise version or a dated build for tighter pinning. See the [published tags](https://github.com/orgs/bare-devcontainer/packages/container/package/mise) for what is currently available.

Expand Down Expand Up @@ -32,12 +32,15 @@ The installed runtimes are stored in the persisted data volume, so they remain a

## Persistent Caches

mise's data directory and download cache are persisted in named volumes, so toolchains installed with mise survive container rebuilds and don't need to be re-downloaded:
mise's data directory and download cache are persisted in named volumes, so toolchains installed with mise survive container rebuilds and don't need to be re-downloaded. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-mise-data` | `/home/dev/.local/share/mise` | mise-managed toolchains |
| `${devcontainerId}-mise-cache` | `/home/dev/.cache/mise` | mise's download cache |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Tips

Expand Down
9 changes: 6 additions & 3 deletions src/mise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Security-focused mise dev container for multiple runtimes, with cached tool inst

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| imageVariant | Debian version (trixie = Debian 13, bookworm = Debian 12). Other published tags can be entered. | string | trixie |
| imageVariant | Debian version (trixie = Debian 13). Other published tags can be entered. | string | trixie |

## Getting Started

See [Getting Started](https://github.com/bare-devcontainer/templates#getting-started) in the repository README for how to apply this template.

## Image Variants

The `imageVariant` option selects the tag of the `ghcr.io/bare-devcontainer/mise` base image, which tracks the Debian release: `trixie` is Debian 13 and `bookworm` is Debian 12.
The `imageVariant` option selects the tag of the `ghcr.io/bare-devcontainer/mise` base image, which tracks the Debian release: `trixie` is Debian 13.

The values offered when applying the template are proposals, not a closed list — any published tag can be entered, including narrower ones such as a mise version or a dated build for tighter pinning. See the [published tags](https://github.com/orgs/bare-devcontainer/packages/container/package/mise) for what is currently available.

Expand Down Expand Up @@ -43,12 +43,15 @@ The installed runtimes are stored in the persisted data volume, so they remain a

## Persistent Caches

mise's data directory and download cache are persisted in named volumes, so toolchains installed with mise survive container rebuilds and don't need to be re-downloaded:
mise's data directory and download cache are persisted in named volumes, so toolchains installed with mise survive container rebuilds and don't need to be re-downloaded. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-mise-data` | `/home/dev/.local/share/mise` | mise-managed toolchains |
| `${devcontainerId}-mise-cache` | `/home/dev/.cache/mise` | mise's download cache |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Tips

Expand Down
7 changes: 3 additions & 4 deletions src/mise/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "mise",
"version": "1.3.3",
"version": "1.4.0",
"name": "mise",
"description": "Security-focused mise dev container for multiple runtimes, with cached tool installs.",
"publisher": "Bare Dev Container Maintainers",
Expand All @@ -9,10 +9,9 @@
"options": {
"imageVariant": {
"type": "string",
"description": "Debian version (trixie = Debian 13, bookworm = Debian 12). Other published tags can be entered.",
"description": "Debian version (trixie = Debian 13). Other published tags can be entered.",
"proposals": [
"trixie",
"bookworm"
"trixie"
],
"default": "trixie"
}
Expand Down
6 changes: 6 additions & 0 deletions src/node/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"source": "${devcontainerId}-node-corepack-cache",
"target": "/home/dev/.cache/node/corepack",
"type": "volume"
},
// Persist the shell history the image keeps in this directory.
{
"source": "${devcontainerId}-bash-history",
"target": "/home/dev/.local/state/bash",
"type": "volume"
}
]
}
5 changes: 4 additions & 1 deletion src/node/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

Corepack's cache directory is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading package managers:
Corepack's cache directory is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading package managers. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-node-corepack-cache` | `/home/dev/.cache/node/corepack` | Corepack's cache of downloaded `yarn`/`pnpm` releases |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Tips

Expand Down
5 changes: 4 additions & 1 deletion src/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ After applying the template, we recommend pinning the image to a digest so every

## Persistent Caches

Corepack's cache directory is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading package managers:
Corepack's cache directory is persisted in a named volume, so rebuilding the container to pick up image updates doesn't require re-downloading package managers. Bash history is persisted the same way, so a rebuild doesn't clear it:

| Volume | Mount path | Purpose |
|--------|------------|---------|
| `${devcontainerId}-node-corepack-cache` | `/home/dev/.cache/node/corepack` | Corepack's cache of downloaded `yarn`/`pnpm` releases |
| `${devcontainerId}-bash-history` | `/home/dev/.local/state/bash` | Bash history file that `HISTFILE` points at |

The image sets `HISTFILE` to `/home/dev/.local/state/bash/history` rather than the default `~/.bash_history`, so bash writes into the volume.

## Tips

Expand Down
2 changes: 1 addition & 1 deletion src/node/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "node",
"version": "1.1.2",
"version": "1.2.0",
"name": "Node.js",
"description": "Security-focused Node.js dev container for JS/TS with non-root defaults and Corepack.",
"publisher": "Bare Dev Container Maintainers",
Expand Down
Loading
Loading