Requirements
To build thecontainer project, you need:
- Mac with Apple silicon
- macOS 15 minimum, macOS 26 recommended
- Xcode 26, set as the active developer directory
Compile and test
Buildcontainer and the background services from source, and run basic and integration tests:
Install locally
Copy the binaries to/usr/local/bin and /usr/local/libexec (requires entering an administrator password):
Release build
To install a release build, with better performance than the debug build:Release builds include optimizations that significantly improve runtime performance. Use release builds for performance testing and production use.
Compile protobufs
container uses gRPC to communicate to the builder virtual machine that creates images from Dockerfiles, and depends on specific versions of grpc-swift and swift-protobuf.
If you make changes to the gRPC APIs in the container-builder-shim project, install the tools and re-generate the gRPC code in this project using:
Develop using a local copy of Containerization
To make changes tocontainer that require changes to the Containerization project, or vice versa:
Clone Containerization repository
Clone the Containerization repository such that it sits next to your clone of the
container repository. Ensure that you follow containerization instructions to prepare your build environment.Configure local dependency
Reconfigure the Swift project to use your local
containerization package and update your Package.resolved file:Update init filesystem (optional)
If you want
container to use any changes you made in the vminit subproject of Containerization, update the system property to use the locally built init filesystem image:Revert to normal dependency
To revert to using the Containerization dependency from yourPackage.swift:
Revert init filesystem property
If you were using the local init filesystem, revert the system property to its default value:
Restore dependency
Use the Swift package manager to restore the normal
containerization dependency and update your Package.resolved file. If you are using Xcode, revert your Package.swift change instead of using swift package unedit:Develop using a local copy of container-builder-shim
To test changes that require thecontainer-builder-shim project:
Clone and modify
Clone the container-builder-shim repository and navigate to its directory. Make your necessary changes.
Build custom builder image
Build the custom builder image, set it as the active builder image, and remove the existing
buildkit container so the new image will be used: