- integrations
- Get started
- Use ocx in a dev container
Use ocx in a dev container
The ocx Dev Container Feature installs the ocx command-line tool in a dev container and restores the tools your project pins in ocx.toml.
{ "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/ocx-sh/devcontainer-features/ocx:1": {} }}Add ocx with one line
Add the feature reference ghcr.io/ocx-sh/devcontainer-features/ocx:1 to the features object of your devcontainer.json, then rebuild the container.
Open a terminal and run ocx version.
The quickstart walks through the first run and adds a tool.
This documentation is for developers and platform teams who add the feature to a devcontainer.json.
The tag :1 keeps the feature on major version 1, so a rebuild takes minor and patch releases without an edit to your file.
Pick a goal
- Add ocx and run a first tool
- Pin the ocx version or follow the newest release
- Restore the project toolchain when the container is created
- Run ocx as root, a named user or a split user
- Use ocx on Alpine and other minimal images
- Build behind a proxy and a custom CA
- Install from a mirror or with no internet
- Apply organisation-managed configuration
- Prebuild the container in Codespaces and CI
- Fix a failed feature install, a rejected option, a lock or permission error, a tool missing from the terminal or a restore warning
Look it up
- Supported images lists the base images and architectures the feature installs on
- Options describes every option and its default
- Files, environment and exit codes lists what the feature writes and what each exit code means
- Installer variables and feature options maps the official install script to the options
- How the install works explains what the build does
- What the feature trusts explains the defaults that activate projects and fetch the manifest
- Changelog lists the feature releases and the ocx version each one pins
- Source and issues for the feature on GitHub
- The ocx project for the package manager the feature installs
- The Dev Containers specification for how a feature reaches your container