Merge pull request #1372 from jessvalarezo/d4m-gettingstarted
Supplement Building documentation for Docker for Mac users.
This commit is contained in:
commit
ed1c40420e
60
BUILDING.md
60
BUILDING.md
@ -45,6 +45,8 @@ sudo make install
|
||||
|
||||
## Via Docker Container
|
||||
|
||||
### Build containerd
|
||||
|
||||
You can build `containerd` via Docker container. You can build an image from
|
||||
this `Dockerfile`:
|
||||
|
||||
@ -71,3 +73,61 @@ You can move the binaries in your `$PATH` with the command:
|
||||
```sh
|
||||
sudo make install
|
||||
```
|
||||
|
||||
### Build runc and containerd
|
||||
|
||||
To have complete core container runtime, you will need both `containerd` and `runc`. It is possible to build both of these via Docker container.
|
||||
|
||||
You can use `go` to checkout `runc` in your `GOPATH`:
|
||||
|
||||
```sh
|
||||
go get github.com/opencontainers/runc
|
||||
```
|
||||
|
||||
We can build an image from this `Dockerfile`
|
||||
|
||||
```sh
|
||||
FROM golang
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y btrfs-tools libapparmor-dev libseccomp-dev
|
||||
|
||||
```
|
||||
|
||||
In our Docker container we will use a specific `runc` build which includes [seccomp](https://en.wikipedia.org/wiki/seccomp) and [apparmor](https://en.wikipedia.org/wiki/AppArmor) support. Hence why our Dockerfile includes these dependencies: `libapparmor-dev` `libseccomp-dev`.
|
||||
|
||||
Let's suppose you build an image called `containerd/build` from the above Dockerfile. You can run the following command:
|
||||
|
||||
```sh
|
||||
docker run -it --privileged \
|
||||
-v /var/lib/containerd \
|
||||
-v ${GOPATH}/src/github.com/opencontainers/runc:/go/src/github.com/opencontainers/runc \
|
||||
-v ${GOPATH}/src/github.com/containerd/containerd:/go/src/github.com/containerd/containerd \
|
||||
-e GOPATH=/go
|
||||
-w /go/src/github.com/containerd/containerd containerd/build sh
|
||||
```
|
||||
|
||||
This mounts both `runc` and `containerd` repositories in our Docker container.
|
||||
|
||||
From within our Docker container let's build `containerd`
|
||||
|
||||
```sh
|
||||
cd /go/src/github.com/containerd/containerd
|
||||
make && make install
|
||||
```
|
||||
|
||||
These binaries can be found in the `./bin` directory in your host.
|
||||
`make install` will move the binaries in your `$PATH`.
|
||||
|
||||
Next, let's build `runc`
|
||||
|
||||
```sh
|
||||
cd /go/src/github.com/opencontainers/runc
|
||||
make BUILDTAGS='seccomp apparmor' && make install
|
||||
```
|
||||
|
||||
When working with `ctr`, the containerd CLI we just built, don't forget to start `containerd`!
|
||||
|
||||
```sh
|
||||
containerd --config config.toml
|
||||
```
|
||||
|
10
RUNC.md
10
RUNC.md
@ -1,11 +1,17 @@
|
||||
containerd is built with OCI support and with support for advanced features provided by `runc`.
|
||||
containerd is built with OCI support and with support for advanced features provided by [runc](https://github.com/opencontainers/runc).
|
||||
|
||||
We depend on a specific runc version when dealing with advanced features. You should have a specific build for development. The current supported runc commit is:
|
||||
We depend on a specific `runc` version when dealing with advanced features. You should have a specific runc build for development. The current supported runc commit is:
|
||||
|
||||
RUNC_COMMIT = e775f0fba3ea329b8b766451c892c41a3d49594d
|
||||
|
||||
For more information on how to clone and build runc see the runc Building [documentation](https://github.com/opencontainers/runc#building).
|
||||
|
||||
Note: before building you may need to install additional support, which will vary by platform. For example, you may need to install `libseccomp` and `libapparmor` e.g. `libseccomp-dev` and `libapparmor-dev` for Ubuntu.
|
||||
|
||||
## building
|
||||
|
||||
From within your `opencontainers/runc` repository run:
|
||||
|
||||
### apparmor
|
||||
|
||||
```bash
|
||||
|
Loading…
Reference in New Issue
Block a user