This guide will help familiarize contributors to the containerd/containerd repository.
First read the containerd project's general guidelines around contribution which apply to all containerd projects.
See BUILDING.md for instructions for setting up a development environment.
If you are also a new user to containerd, you can first check out the Getting started with containerd guide.
At a minimum, the dev tools from script/setup/install-dev-tools should be installed.
Run make install-deps to install dependencies used for running and developing the CRI plugin.
Other install scripts under script/setup may need to be run depending on your environment and your preference for installing libraries and dependencies.
The versions used by containerd/containerd CI can be found in script/setup and referred to if installing manually.
$ script/setup/install-dev-tools
$ make install-deps
- Before starting work on an issue, check whether an open pull request already addresses it: look at the issue's linked pull requests and search open pull requests for the issue number.
- Document features and enhancements, both at the code level and in the
user-facing docs under
docs/. - Test at the levels that fit the change: unit, integration, or end-to-end.
For failure injection in integration tests, use the failpoint pattern
(
internal/failpoint,integration/failpoint). - Run
make checkand the tests that cover your change locally before opening or updating a pull request. - Monitor your pull request's CI runs and make sure your changes are not responsible for failures.
Pull requests must be opened by a human. Any use of automation to create pull requests must be approved by a maintainer. Accounts creating pull requests using automation without prior approval may be restricted from the containerd organization.
All AI-generated or AI-assisted submissions — whether code, PR descriptions, or comments — must be reviewed by the human author before being submitted. The human author is responsible for the correctness and quality of all content in their pull request and any associated comments.
- Go files adhere to standard Go formatting and styling
- Protobuf files use tabs for indentation
- Other files must not contain trailing whitespace and should end with a single new line character
Use the check command in the makefile to verify your code matches the expected style.
make check
Ensure protoc and dev tools have been installed, then run make protos
Note When running
make protos, the current working directory should be found under theGOPATHenvironment variable to ensure protoc can properly resolve the paths of protofiles in the project.
Package names should be short and simple. Avoid using _ and repeating words from parent directories.
Try to put a new package under the appropriate root directories. The root directory is reserved for configuration and build files, no source files will be accepted in root since containerd v2.0.
api- All protobuf service definitions and types used by servicesbin- Autogenerated during build, do not check in file hereclient- All Go files for the containerd client (formerly incontainerd/containerdroot in 1.x)cmd- All Go main packages and the packages used only for that main packagecontrib- Files, configurations, and packages related to external tools or librariescore- Core Go packages with interface definitions and built-in implementationsdocs- All containerd technical documentation using markdowninternal- All utility packages used by containerd and not intended for direct importman- All containerd reference manuals used for themancommandpkg- Non-core Go packages used by clients and other containerd packagesplugins- All included containerd plugins which are registered via initreleases- All release note filesscript- All scripts used for testing, development, and CItest- Test scripts used for external end to end testing of containerd, do not add new files herevendor- Autogenerated vendor files frommake vendorcommand, do not manually edit files hereversion- Version package with the current containerd version