You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BUILDING.md
+33-21Lines changed: 33 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,9 @@ To build the `container` project, you need:
6
6
- macOS 15 minimum, macOS 26 beta recommended
7
7
- Xcode 26 beta, set as the [active developer directory](https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-HOW_DO_I_SELECT_THE_DEFAULT_VERSION_OF_XCODE_TO_USE_FOR_MY_COMMAND_LINE_TOOLS_)
8
8
9
+
> [!IMPORTANT]
10
+
> There is a bug in the `vmnet` framework on macOS 26 beta that causes network creation to fail if the `container` helper applications are located under your `Documents` or `Desktop` directories. If you use `make install`, you can simply run the `container` binary in `/usr/local`. If you prefer to use the binaries that `make all` creates in your project `bin` and `libexec` directories, locate your project elsewhere, such as `~/projects/container`, until this issue is resolved.
11
+
9
12
## Compile and test
10
13
11
14
Build `container` and the background services from source, and run basic and integration tests:
@@ -20,6 +23,13 @@ Copy the binaries to `/usr/local/bin` and `/usr/local/libexec` (requires enterin
20
23
make install
21
24
```
22
25
26
+
Or to install a release build, with better performance than the debug build:
27
+
28
+
```bash
29
+
BUILD_CONFIGURATION=release make all test integration
30
+
BUILD_CONFIGURATION=release make install
31
+
```
32
+
23
33
## Compile protobufs
24
34
25
35
`container` uses gRPC to communicate to the builder virtual machine that creates images from `Dockerfile`s, and depends on specific versions of `grpc-swift` and `swift-protobuf`. If you make changes to the gRPC APIs in the [container-builder-shim](https://github.com/apple/container-builder-shim) project, install the tools and re-generate the gRPC code in this project using:
@@ -38,58 +48,60 @@ to prepare your build environment.
38
48
39
49
2. In your development shell, go to the `container` project directory.
40
50
41
-
```
51
+
```bash
42
52
cd container
43
53
```
44
54
45
55
3. If the `container` services are already running, stop them.
46
56
47
-
```
57
+
```bash
48
58
bin/container system stop
49
59
```
50
60
51
-
4. Configure the environment variable `CONTAINERIZATION_PATH` to refer to your Containerization project, and update your `Package.resolved` file.
52
-
53
-
```
54
-
export CONTAINERIZATION_PATH=../containerization
55
-
swift package update containerization
56
-
```
57
-
58
-
5. Build the init filesystem for your local copy of the Containerization project.
61
+
4. Use the Swift package manager to configure use your local`containerization` package and update your `Package.resolved` file.
> If you are using Xcode, you will need to temporarily modify `Package.swift` instead of using `swift package edit`, using a path dependency in place of the versioned `container` dependency:
70
+
>
71
+
>```swift
72
+
> .package(path: "../containerization"),
73
+
>```
74
+
5. Build `container`.
65
75
66
76
```
67
77
make clean all
68
78
```
69
79
70
-
7. Start the `container` services.
80
+
6. Restart the `container` services.
71
81
72
82
```
83
+
bin/container system stop
73
84
bin/container system start
74
85
```
75
86
76
87
To revert to using the Containerization dependency from your `Package.swift`:
77
88
78
-
1. Unset your `CONTAINERIZATION_PATH` environment variable, and update `Package.resolved`.
89
+
1. 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`.
0 commit comments