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
+51-40Lines changed: 51 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,46 +150,44 @@ make STATIC=1
150
150
151
151
# Via Docker container
152
152
153
-
The following instructions assume you are at the parent directory of containerd source directory.
153
+
> [!NOTE]
154
+
> The following instructions assume you are at the **parent** directory of containerd source directory.
154
155
155
156
## Build containerd in a container
156
157
157
-
You can build `containerd` via a Linux-based Docker container.
158
-
You can build an image from this `Dockerfile`:
158
+
You can build `containerd` via a Linux-based Docker container using the [Docker official `golang` image](https://hub.docker.com/_/golang/)
159
159
160
-
```dockerfile
161
-
FROM golang
162
-
```
163
-
164
-
Let's suppose that you built an image called `containerd/build`. From the
165
-
containerd source root directory you can run the following command:
160
+
From the **parent** directory of `containerd`'s cloned repo you can run the following command:
-w /go/src/github.com/containerd/containerd containerd/build sh
164
+
-v ${PWD}/containerd:/src/containerd \
165
+
-w /src/containerd golang
172
166
```
173
167
174
-
This mounts `containerd` repository
175
-
176
-
You are now ready to [build](#build-containerd):
168
+
This mounts the `containerd` repository inside the image at `/src/containerd` and, by default, runs a shell at that directory.
177
169
178
-
```sh
179
-
make && make install
180
-
```
170
+
Now, you are now ready to follow the [build instructions](#build-containerd):
181
171
182
172
## Build containerd and runc in a container
183
173
184
174
To have complete core container runtime, you will need both `containerd` and `runc`. It is possible to build both of these via Docker container.
185
175
186
-
You can use `git` to checkout `runc`:
176
+
You can clone `runc` in the same parent directory where you cloned `containerd` and you should clone [the latest stable version of `runc`](https://github.com/opencontainers/runc/releases), e.g. v1.1.13:
and [AppArmor](https://en.wikipedia.org/wiki/AppArmor) support. Seccomp support
185
+
in runc requires `libseccomp-dev` as a dependency (AppArmor and SELinux support
186
+
do not require external libraries at build time). Refer to [RUNC.md](docs/RUNC.md)
187
+
in the docs directory to for details about building runc, and to learn about
188
+
supported versions of `runc` as used by containerd.
189
+
190
+
Since we need [`libseccomp-dev`](https://packages.debian.org/stable/libseccomp-dev) installed as a dependency, we will need a custom Docker image derived from the official `golang` image. You can use the following `Dockerfile` to build your custom image:
193
191
194
192
```sh
195
193
FROM golang
@@ -198,44 +196,57 @@ RUN apt-get update && \
198
196
apt-get install -y libseccomp-dev
199
197
```
200
198
201
-
In our Docker container we will build `runc` build, which includes
0 commit comments