• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.empty-mod/H19-Jul-2021-1211

.github/H19-Jul-2021-1,158999

.zuul/playbooks/containerd-build/H19-Jul-2021-141134

api/H03-May-2022-49,54946,260

archive/H19-Jul-2021-3,8312,890

cio/H19-Jul-2021-1,070772

cluster/gce/H19-Jul-2021-

cmd/H19-Jul-2021-11,9778,932

containers/H19-Jul-2021-11329

content/H19-Jul-2021-3,8052,658

contrib/H19-Jul-2021-3,1092,324

defaults/H19-Jul-2021-14234

design/H03-May-2022-445322

diff/H19-Jul-2021-1,8421,300

docs/H03-May-2022-3,7092,948

errdefs/H19-Jul-2021-348214

events/H19-Jul-2021-660496

filters/H19-Jul-2021-1,7711,373

gc/H19-Jul-2021-886586

identifiers/H19-Jul-2021-14884

images/H19-Jul-2021-2,7051,920

integration/H19-Jul-2021-13,1289,913

labels/H19-Jul-2021-11450

leases/H19-Jul-2021-365212

log/H19-Jul-2021-20490

metadata/H19-Jul-2021-9,1217,226

metrics/H19-Jul-2021-3,0582,538

mount/H19-Jul-2021-1,6291,013

namespaces/H19-Jul-2021-369189

oci/H19-Jul-2021-3,4212,675

pkg/H19-Jul-2021-33,23323,453

platforms/H19-Jul-2021-1,8671,340

plugin/H19-Jul-2021-475283

protobuf/plugin/H19-Jul-2021-328230

reference/H19-Jul-2021-1,160749

releases/H19-Jul-2021-837626

remotes/H19-Jul-2021-6,7454,559

reports/H19-Jul-2021-1,329942

rootfs/H19-Jul-2021-532345

runtime/H19-Jul-2021-26,52723,371

script/H19-Jul-2021-721361

services/H19-Jul-2021-5,8684,236

snapshots/H19-Jul-2021-11,0547,782

sys/H19-Jul-2021-1,619929

test/H19-Jul-2021-465222

vendor/H03-May-2022-877,195698,641

version/H19-Jul-2021-358

.gitattributesH A D19-Jul-202116 11

.gitignoreH A D19-Jul-2021125 1110

.golangci.ymlH A D19-Jul-2021325 2825

.mailmapH A D19-Jul-20215.9 KiB126125

.zuul.yamlH A D19-Jul-2021941 3632

ADOPTERS.mdH A D19-Jul-20215.5 KiB4928

BUILDING.mdH A D19-Jul-202110.6 KiB280199

LICENSEH A D19-Jul-202110.5 KiB192160

MakefileH A D19-Jul-202113.7 KiB404300

Makefile.darwinH A D19-Jul-2021739 234

Makefile.freebsdH A D19-Jul-2021740 234

Makefile.linuxH A D19-Jul-2021990 3211

Makefile.windowsH A D19-Jul-2021817 298

NOTICEH A D19-Jul-2021519 1710

Protobuild.tomlH A D19-Jul-20212.7 KiB7261

README.mdH A D19-Jul-202115.2 KiB333228

RELEASES.mdH A D19-Jul-202115.4 KiB330244

ROADMAP.mdH A D19-Jul-20211.3 KiB2917

SCOPE.mdH A D19-Jul-20214.5 KiB5839

VagrantfileH A D19-Jul-20218.8 KiB261243

client.goH A D19-Jul-202124.3 KiB834626

client_opts.goH A D19-Jul-20216.7 KiB246162

code-of-conduct.mdH A D19-Jul-2021155 42

codecov.ymlH A D19-Jul-202115 21

container.goH A D19-Jul-202112.1 KiB462372

container_checkpoint_opts.goH A D19-Jul-20215 KiB157119

container_opts.goH A D19-Jul-20218.8 KiB289208

container_opts_unix.goH A D19-Jul-20213.4 KiB11786

container_restore_opts.goH A D19-Jul-20214.9 KiB150111

containerd.serviceH A D19-Jul-20211.2 KiB4136

containerstore.goH A D19-Jul-20215.4 KiB197153

diff.goH A D19-Jul-20213.1 KiB11787

events.goH A D19-Jul-20212.7 KiB12389

export.goH A D19-Jul-20211,005 329

go.modH A D19-Jul-20213.2 KiB8379

go.sumH A D19-Jul-202171.1 KiB743742

grpc.goH A D19-Jul-20211.6 KiB5329

image.goH A D19-Jul-202112.1 KiB451330

image_store.goH A D19-Jul-20213.9 KiB155115

import.goH A D19-Jul-20214.9 KiB206151

install.goH A D19-Jul-20212.8 KiB11590

install_opts.goH A D19-Jul-20211.3 KiB4818

lease.goH A D19-Jul-20211.4 KiB5528

namespaces.goH A D19-Jul-20212.8 KiB12281

process.goH A D19-Jul-20216.2 KiB243178

pull.goH A D19-Jul-20217 KiB256186

services.goH A D19-Jul-20213.9 KiB12382

signals.goH A D19-Jul-20212.2 KiB8452

signals_unix.goH A D19-Jul-20211.2 KiB4419

signals_windows.goH A D19-Jul-20211.9 KiB6440

snapshotter_default_linux.goH A D19-Jul-2021847 254

snapshotter_default_unix.goH A D19-Jul-2021878 274

snapshotter_default_windows.goH A D19-Jul-2021845 254

snapshotter_opts_unix.goH A D19-Jul-20211.2 KiB3611

task.goH A D19-Jul-202118.5 KiB700549

task_opts.goH A D19-Jul-20216.4 KiB220161

task_opts_unix.goH A D19-Jul-20214.4 KiB158126

unpacker.goH A D19-Jul-20219.2 KiB354286

README.md

1![containerd banner](https://raw.githubusercontent.com/cncf/artwork/master/projects/containerd/horizontal/color/containerd-horizontal-color.png)
2
3[![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/containerd)](https://pkg.go.dev/github.com/containerd/containerd)
4[![Build Status](https://github.com/containerd/containerd/workflows/CI/badge.svg)](https://github.com/containerd/containerd/actions?query=workflow%3ACI)
5[![Nightlies](https://github.com/containerd/containerd/workflows/Nightly/badge.svg)](https://github.com/containerd/containerd/actions?query=workflow%3ANightly)
6[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fcontainerd%2Fcontainerd.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fcontainerd%2Fcontainerd?ref=badge_shield)
7[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/containerd)](https://goreportcard.com/report/github.com/containerd/containerd)
8[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1271/badge)](https://bestpractices.coreinfrastructure.org/projects/1271)
9
10containerd is an industry-standard container runtime with an emphasis on simplicity, robustness and portability. It is available as a daemon for Linux and Windows, which can manage the complete container lifecycle of its host system: image transfer and storage, container execution and supervision, low-level storage and network attachments, etc.
11
12containerd is a member of CNCF with ['graduated'](https://landscape.cncf.io/selected=containerd) status.
13
14containerd is designed to be embedded into a larger system, rather than being used directly by developers or end-users.
15
16![architecture](design/architecture.png)
17
18## Now Recruiting
19
20We are a large inclusive OSS project that is welcoming help of any kind shape or form:
21* Documentation help is needed to make the product easier to consume and extend.
22* We need OSS community outreach / organizing help to get the word out; manage
23and create messaging and educational content; and to help with social media, community forums/groups, and google groups.
24* We are actively inviting new [security advisors](https://github.com/containerd/project/blob/master/GOVERNANCE.md#security-advisors) to join the team.
25* New sub-projects are being created, core and non-core that could use additional development help.
26* Each of the [containerd projects](https://github.com/containerd) has a list of issues currently being worked on or that need help resolving.
27  - If the issue has not already been assigned to someone, or has not made recent progress and you are interested, please inquire.
28  - If you are interested in starting with a smaller / beginner level issue, look for issues with an `exp/beginner` tag, for example [containerd/containerd beginner issues.](https://github.com/containerd/containerd/issues?q=is%3Aissue+is%3Aopen+label%3Aexp%2Fbeginner)
29
30## Getting Started
31
32See our documentation on [containerd.io](https://containerd.io):
33* [for ops and admins](docs/ops.md)
34* [namespaces](docs/namespaces.md)
35* [client options](docs/client-opts.md)
36
37See how to build containerd from source at [BUILDING](BUILDING.md).
38
39If you are interested in trying out containerd see our example at [Getting Started](docs/getting-started.md).
40
41## Nightly builds
42
43There are nightly builds available for download [here](https://github.com/containerd/containerd/actions?query=workflow%3ANightly).
44Binaries are generated from `master` branch every night for `Linux` and `Windows`.
45
46Please be aware: nightly builds might have critical bugs, it's not recommended for use in production and no support provided.
47
48## Runtime Requirements
49
50Runtime requirements for containerd are very minimal. Most interactions with
51the Linux and Windows container feature sets are handled via [runc](https://github.com/opencontainers/runc) and/or
52OS-specific libraries (e.g. [hcsshim](https://github.com/Microsoft/hcsshim) for Microsoft).
53The current required version of `runc` is described in [RUNC.md](docs/RUNC.md).
54
55There are specific features
56used by containerd core code and snapshotters that will require a minimum kernel
57version on Linux. With the understood caveat of distro kernel versioning, a
58reasonable starting point for Linux is a minimum 4.x kernel version.
59
60The overlay filesystem snapshotter, used by default, uses features that were
61finalized in the 4.x kernel series. If you choose to use btrfs, there may
62be more flexibility in kernel version (minimum recommended is 3.18), but will
63require the btrfs kernel module and btrfs tools to be installed on your Linux
64distribution.
65
66To use Linux checkpoint and restore features, you will need `criu` installed on
67your system. See more details in [Checkpoint and Restore](#checkpoint-and-restore).
68
69Build requirements for developers are listed in [BUILDING](BUILDING.md).
70
71## Features
72
73### Client
74
75containerd offers a full client package to help you integrate containerd into your platform.
76
77```go
78
79import (
80  "github.com/containerd/containerd"
81  "github.com/containerd/containerd/cio"
82)
83
84
85func main() {
86	client, err := containerd.New("/run/containerd/containerd.sock")
87	defer client.Close()
88}
89
90```
91
92### Namespaces
93
94Namespaces allow multiple consumers to use the same containerd without conflicting with each other.  It has the benefit of sharing content but still having separation with containers and images.
95
96To set a namespace for requests to the API:
97
98```go
99context = context.Background()
100// create a context for docker
101docker = namespaces.WithNamespace(context, "docker")
102
103containerd, err := client.NewContainer(docker, "id")
104```
105
106To set a default namespace on the client:
107
108```go
109client, err := containerd.New(address, containerd.WithDefaultNamespace("docker"))
110```
111
112### Distribution
113
114```go
115// pull an image
116image, err := client.Pull(context, "docker.io/library/redis:latest")
117
118// push an image
119err := client.Push(context, "docker.io/library/redis:latest", image.Target())
120```
121
122### Containers
123
124In containerd, a container is a metadata object.  Resources such as an OCI runtime specification, image, root filesystem, and other metadata can be attached to a container.
125
126```go
127redis, err := client.NewContainer(context, "redis-master")
128defer redis.Delete(context)
129```
130
131### OCI Runtime Specification
132
133containerd fully supports the OCI runtime specification for running containers.  We have built in functions to help you generate runtime specifications based on images as well as custom parameters.
134
135You can specify options when creating a container about how to modify the specification.
136
137```go
138redis, err := client.NewContainer(context, "redis-master", containerd.WithNewSpec(oci.WithImageConfig(image)))
139```
140
141### Root Filesystems
142
143containerd allows you to use overlay or snapshot filesystems with your containers.  It comes with built in support for overlayfs and btrfs.
144
145```go
146// pull an image and unpack it into the configured snapshotter
147image, err := client.Pull(context, "docker.io/library/redis:latest", containerd.WithPullUnpack)
148
149// allocate a new RW root filesystem for a container based on the image
150redis, err := client.NewContainer(context, "redis-master",
151	containerd.WithNewSnapshot("redis-rootfs", image),
152	containerd.WithNewSpec(oci.WithImageConfig(image)),
153)
154
155// use a readonly filesystem with multiple containers
156for i := 0; i < 10; i++ {
157	id := fmt.Sprintf("id-%s", i)
158	container, err := client.NewContainer(ctx, id,
159		containerd.WithNewSnapshotView(id, image),
160		containerd.WithNewSpec(oci.WithImageConfig(image)),
161	)
162}
163```
164
165### Tasks
166
167Taking a container object and turning it into a runnable process on a system is done by creating a new `Task` from the container.  A task represents the runnable object within containerd.
168
169```go
170// create a new task
171task, err := redis.NewTask(context, cio.NewCreator(cio.WithStdio))
172defer task.Delete(context)
173
174// the task is now running and has a pid that can be used to setup networking
175// or other runtime settings outside of containerd
176pid := task.Pid()
177
178// start the redis-server process inside the container
179err := task.Start(context)
180
181// wait for the task to exit and get the exit status
182status, err := task.Wait(context)
183```
184
185### Checkpoint and Restore
186
187If you have [criu](https://criu.org/Main_Page) installed on your machine you can checkpoint and restore containers and their tasks.  This allows you to clone and/or live migrate containers to other machines.
188
189```go
190// checkpoint the task then push it to a registry
191checkpoint, err := task.Checkpoint(context)
192
193err := client.Push(context, "myregistry/checkpoints/redis:master", checkpoint)
194
195// on a new machine pull the checkpoint and restore the redis container
196checkpoint, err := client.Pull(context, "myregistry/checkpoints/redis:master")
197
198redis, err = client.NewContainer(context, "redis-master", containerd.WithNewSnapshot("redis-rootfs", checkpoint))
199defer container.Delete(context)
200
201task, err = redis.NewTask(context, cio.NewCreator(cio.WithStdio), containerd.WithTaskCheckpoint(checkpoint))
202defer task.Delete(context)
203
204err := task.Start(context)
205```
206
207### Snapshot Plugins
208
209In addition to the built-in Snapshot plugins in containerd, additional external
210plugins can be configured using GRPC. An external plugin is made available using
211the configured name and appears as a plugin alongside the built-in ones.
212
213To add an external snapshot plugin, add the plugin to containerd's config file
214(by default at `/etc/containerd/config.toml`). The string following
215`proxy_plugin.` will be used as the name of the snapshotter and the address
216should refer to a socket with a GRPC listener serving containerd's Snapshot
217GRPC API. Remember to restart containerd for any configuration changes to take
218effect.
219
220```
221[proxy_plugins]
222  [proxy_plugins.customsnapshot]
223    type = "snapshot"
224    address =  "/var/run/mysnapshotter.sock"
225```
226
227See [PLUGINS.md](/docs/PLUGINS.md) for how to create plugins
228
229### Releases and API Stability
230
231Please see [RELEASES.md](RELEASES.md) for details on versioning and stability
232of containerd components.
233
234Downloadable 64-bit Intel/AMD binaries of all official releases are available on
235our [releases page](https://github.com/containerd/containerd/releases).
236
237For other architectures and distribution support, you will find that many
238Linux distributions package their own containerd and provide it across several
239architectures, such as [Canonical's Ubuntu packaging](https://launchpad.net/ubuntu/bionic/+package/containerd).
240
241#### Enabling command auto-completion
242
243Starting with containerd 1.4, the urfave client feature for auto-creation of bash and zsh
244autocompletion data is enabled. To use the autocomplete feature in a bash shell for example, source
245the autocomplete/ctr file in your `.bashrc`, or manually like:
246
247```
248$ source ./contrib/autocomplete/ctr
249```
250
251#### Distribution of `ctr` autocomplete for bash and zsh
252
253For bash, copy the `contrib/autocomplete/ctr` script into
254`/etc/bash_completion.d/` and rename it to `ctr`. The `zsh_autocomplete`
255file is also available and can be used similarly for zsh users.
256
257Provide documentation to users to `source` this file into their shell if
258you don't place the autocomplete file in a location where it is automatically
259loaded for the user's shell environment.
260
261### CRI
262
263`cri` is a [containerd](https://containerd.io/) plugin implementation of the Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/cri-api/blob/master/pkg/apis/runtime/v1alpha2/api.proto). With it, you are able to use containerd as the container runtime for a Kubernetes cluster.
264
265![cri](./docs/cri/cri.png)
266
267#### CRI Status
268
269`cri` is a native plugin of containerd. Since containerd 1.1, the cri plugin is built into the release binaries and enabled by default.
270
271> **Note:** As of containerd 1.5, the `cri` plugin is merged into the containerd/containerd repo. For example, the source code previously stored under [`containerd/cri/pkg`](https://github.com/containerd/cri/tree/release/1.4/pkg)
272was moved to [`containerd/containerd/pkg/cri` package](https://github.com/containerd/containerd/tree/master/pkg/cri).
273
274The `cri` plugin has reached GA status, representing that it is:
275* Feature complete
276* Works with Kubernetes 1.10 and above
277* Passes all [CRI validation tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-validation.md).
278* Passes all [node e2e tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/e2e-node-tests.md).
279* Passes all [e2e tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/e2e-tests.md).
280
281See results on the containerd k8s [test dashboard](https://k8s-testgrid.appspot.com/sig-node-containerd)
282
283#### Validating Your `cri` Setup
284A Kubernetes incubator project, [cri-tools](https://github.com/kubernetes-sigs/cri-tools), includes programs for exercising CRI implementations. More importantly, cri-tools includes the program `critest` which is used for running [CRI Validation Testing](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-validation.md).
285
286#### CRI Guides
287* [Installing with Ansible and Kubeadm](contrib/ansible/README.md)
288* [For Non-Ansible Users, Preforming a Custom Installation Using the Release Tarball and Kubeadm](docs/cri/installation.md)
289* [CRI Plugin Testing Guide](./docs/cri/testing.md)
290* [Debugging Pods, Containers, and Images with `crictl`](./docs/cri/crictl.md)
291* [Configuring `cri` Plugins](./docs/cri/config.md)
292* [Configuring containerd](https://github.com/containerd/containerd/blob/master/docs/man/containerd-config.8.md)
293
294### Communication
295
296For async communication and long running discussions please use issues and pull requests on the github repo.
297This will be the best place to discuss design and implementation.
298
299For sync communication catch us in the `#containerd` and `#containerd-dev` slack channels on Cloud Native Computing Foundation's (CNCF) slack - `cloud-native.slack.com`. Everyone is welcome to join and chat. [Get Invite to CNCF slack.](https://slack.cncf.io)
300
301### Security audit
302
303A third party security audit was performed by Cure53 in 4Q2018; the [full report](docs/SECURITY_AUDIT.pdf) is available in our docs/ directory.
304
305### Reporting security issues
306
307__If you are reporting a security issue, please reach out discreetly at security@containerd.io__.
308
309## Licenses
310
311The containerd codebase is released under the [Apache 2.0 license](LICENSE).
312The README.md file, and files in the "docs" folder are licensed under the
313Creative Commons Attribution 4.0 International License. You may obtain a
314copy of the license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/.
315
316## Project details
317
318**containerd** is the primary open source project within the broader containerd GitHub repository.
319However, all projects within the repo have common maintainership, governance, and contributing
320guidelines which are stored in a `project` repository commonly for all containerd projects.
321
322Please find all these core project documents, including the:
323 * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md),
324 * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS),
325 * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md)
326
327information in our [`containerd/project`](https://github.com/containerd/project) repository.
328
329## Adoption
330
331Interested to see who is using containerd? Are you using containerd in a project?
332Please add yourself via pull request to our [ADOPTERS.md](./ADOPTERS.md) file.
333