This repo contains devcontainer features created by h4l.
This repository contains a collection of Features:
Install the Foundry Ethereum toolkit via foundryup
.
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/h4l/devcontainer-features/foundry:1": {}
}
}
Mount a Docker volume named devcontainer-home-dir
at /home/vscode
in the devcontainer.
This allows all devcontainers used by a single user to share the same home directory. This can be beneficial for a few reasons:
- devcontainers can share caches, which speeds up the install of personal dotfiles repos on container start
- Shell history is preserved over devcontainer rebuilds
- files can be moved between containers via the home directory
Cons:
- Security: this reduces isolation between containers in that each devcontainer sees the same binaries, shell configuration, etc from the shared home directory volume.
This is intended to be used by an individual via their dev.containers.defaultFeatures
vscode setting.
Note: The name of the volume and home directory path cannot be configured, because the devcontainers feature feature does not provide a way to dynamically generate mounts, they have to be specified statically in the feature's JSON configuration.
// user settings JSON
{
"dev.containers.defaultFeatures": {
"ghcr.io/h4l/devcontainer-features/home-dir-volume:1": {}
}
}
This repo is based on devcontainers/feature-starter. Each Feature has its own sub-folder, containing at least a devcontainer-feature.json
and an entrypoint script install.sh
.