Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
docs: Improve developers installation guide
Browse files Browse the repository at this point in the history
Remove all instructions that are duplicated in the main installation
guides and require developers to install via the O/S installation
instructions as a prerequisite.

Fixes #511.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Sep 11, 2017
1 parent 1fe09bb commit 73fee56
Showing 1 changed file with 18 additions and 62 deletions.
80 changes: 18 additions & 62 deletions docs/developers-clear-containers-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ instructions for any developers eager to try Clear Containers 3.0 and who
want to build Clear Containers from the source code and are familiar with the
process.

## Requirements
## Initial setup

The recommended way to create a development environment is to first install the
packaged versions of the Clear Containers components to create a working
system:

* [Fedora*](fedora-installation-guide.md)
* [Ubuntu*](ubuntu-installation-guide.md)

The installation guide instructions will install all packaged
components, plus docker, the hypervisor and the Clear Containers image
and kernel.

## Requirements to build individual components

* [go 1.8.3](https://golang.org/)
* [gcc](https://gcc.gnu.org/) and associated C language build tooling
Expand All @@ -18,6 +31,10 @@ process.
* [Proxy](https://github.com/clearcontainers/proxy)
* [Shim](https://github.com/clearcontainers/shim)

Since the installation guide will have installed packaged versions of
all required components, it is only necessary to install the source for
the component(s) you wish to develop with.

**IMPORTANT:** Do not combine [Clear Containers 2.1](https://github.com/01org/cc-oci-runtime) and [Clear Containers 3.0](https://github.com/clearcontainers).
Both projects ship ``cc-proxy`` and they are not compatible with each other.

Expand Down Expand Up @@ -76,64 +93,3 @@ For more details on the runtime's build system, run:
```bash
$ make help
```

4. Qemu-Lite, Clear Containers image and kernel

In Fedora:
```bash
$ source /etc/os-release
$ sudo -E VERSION_ID=$VERSION_ID dnf config-manager --add-repo \
http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/Fedora\_$VERSION_ID/home:clearcontainers:clear-containers-3.repo
$ sudo -E dnf install -y qemu-lite clear-containers-image linux-container
```

In Ubuntu 16.04 or newer:
```bash
$ sudo -E apt-get install -y apt-transport-https ca-certificates curl software-properties-common
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_$(lsb_release -rs)/ /' >> /etc/apt/sources.list.d/clear-containers.list"
$ curl -fsSL http://download.opensuse.org/repositories/home:/clearcontainers:/clear-containers-3/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add -
$ sudo -E apt-get update
$ sudo -E apt-get install -y qemu-lite clear-containers-image linux-container

```

## Enable Clear Containers 3.0 for Docker

1. Clear Containers configuration file

Edit `$SYSCONFDIR/clear-containers/configuration.toml` according to your needs.

Refer to [https://github.com/clearcontainers/runtime#debugging](https://github.com/clearcontainers/runtime#debugging)
for additional information how to debug the runtime.

2. Configure Docker for Clear Containers 3.0

```bash
$ sudo mkdir -p /etc/systemd/system/docker.service.d/
$ cat << EOF | sudo tee /etc/systemd/system/docker.service.d/clear-containers.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -D --add-runtime cc-runtime=/usr/local/bin/cc-runtime --default-runtime=cc-runtime
[Service]
# Allow maximum number of containers to run.
TasksMax=infinity
EOF
```

3. Restart Docker and Clear Containers systemd services

```bash
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
$ sudo systemctl enable cc-proxy.socket
$ sudo systemctl start cc-proxy.socket
```

## Run Clear Containers 3.0

```bash
$ docker run -it ubuntu bash
root@6adfa8386497732d78468a19da6365602e96e95c401bec2c74ea1af14c672635:/#
```

0 comments on commit 73fee56

Please sign in to comment.