This PR requires installing Xcode 26 beta until we resolve https://github.com/apple/containerization/issues/66.
2.5 KiB
Building the project
To build the container project, you need:
- Mac with Apple silicon
- macOS 15 minimum, macOS 26 beta recommended
- Xcode 26 beta
Compile and test
Build container and the background services from source, and run basic and integration tests:
make all test integration
Copy the binaries to /usr/local/bin and /usr/local/libexec (requires entering an administrator password):
make install
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:
make protos
Develop using a local copy of Containerization
To make changes to container that require changes to the Containerization project, or vice versa:
-
Clone the Containerization repository such that it sits next to your clone of the
containerrepository. Ensure that you follow containerization instructions to prepare your build environment. -
In your development shell, go to the
containerproject directory.cd container -
If the
containerservices are already running, stop them.bin/container system stop -
Configure the environment variable
CONTAINERIZATION_PATHto refer to your Containerization project, and update yourPackage.resolvedfile.export CONTAINERIZATION_PATH=../containerization swift package update containerization -
Build the init filesystem for your local copy of the Containerization project.
(cd ${CONTAINERIZATION_PATH} && make clean all) -
Build
container.make clean all -
Start the
containerservices.bin/container system start
To revert to using the Containerization dependency from your Package.swift:
-
Unset your
CONTAINERIZATION_PATHenvironment variable, and updatePackage.resolved.unset CONTAINERIZATION_PATH swift package update containerization -
Rebuild
container.make clean all -
Restart the
containerservices.bin/container system restart