Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
Go to file
Brian Goff c458bca6dc Handle missing c8d task on stop
In this case, we are sending a signal to the container (typically this
would be SIGKILL or SIGTERM, but could be any signal), but container
reports that the process does not exist.

At the point this code is happening, dockerd thinks that the container
is running, but containerd reports that it is not.

Since containerd reports that it is not running, try to collect the exit
status of the container from containerd, and mark the container as
stopped in dockerd.

Repro this problem like so:

```
id=$(docker run -d busybox top)
pkill containerd && pkill top
docker stop $id
```

Without this change, `docker stop $id` will first try to send SIGTERM,
wait for exit, then try SIGKILL.
Because the process doesn't exist to begin with, no signal is sent, and
so nothing happens.
Since we won't receive any event here to process, the container can
never be marked as stopped until the daemon is restarted.

With the change `docker stop` succeeds immediately (since the process is
already stopped) and we mark the container as stopped. We handle the
case as if we missed a exit event.

There are definitely some other places in the stack that could use some
improvement here, but this helps people get out of a sticky situation.

With io.containerd.runc.v2, no event is ever recieved by docker because
the shim quits trying to send the event.

With io.containerd.runtime.v1.linux the TastExit event is sent before
dockerd can reconnect to the event stream and we miss the event.

No matter what, we shouldn't be reliant on the shim doing the right
thing here, nor can we rely on a steady event stream.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-07-28 10:09:25 -07:00
.github
api Merge pull request #41182 from cpuguy83/runtime_configure_shim 2020-07-14 14:16:04 -07:00
builder vendor: update buildkit to df35e9818 2020-06-15 09:44:41 -07:00
cli remove uses of deprecated pkg/term 2020-04-21 16:29:27 +02:00
client Enable client on netbsd and dragonfly 2020-06-20 01:32:35 +02:00
cmd/dockerd Merge pull request #40930 from thaJeztah/bump_cobra 2020-05-14 21:28:51 +02:00
container Merge pull request #40856 from cpuguy83/reduce_allocs_on_env_repalce 2020-05-12 15:19:10 -07:00
contrib Upgrading the versions of images in Dockerfile. 2020-06-30 12:24:06 +08:00
daemon Handle missing c8d task on stop 2020-07-28 10:09:25 -07:00
distribution fix code note when push all tags 2020-06-16 21:05:10 +08:00
dockerversion Use -X ldflags to set dockerversion package vars 2019-12-02 10:21:41 -08:00
docs docs: sync API v1.39 swagger formatting with current version 2020-07-03 20:32:51 +02:00
errdefs bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
hack testing: bump docker-py 4.2.2 2020-07-17 14:45:28 +02:00
image bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
integration Merge pull request #41065 from AkihiroSuda/cgroup2-ci 2020-07-16 16:55:47 +02:00
integration-cli Merge pull request #41168 from thaJeztah/raise_minimum_memory_limit 2020-07-09 11:48:34 -07:00
internal/test/suite
layer Remove "could not get checksum with tar-split" debug message 2020-03-06 12:45:15 +01:00
libcontainerd Remove unused useShimV2() 2020-07-15 14:28:48 +02:00
oci Move DefaultCapabilities() to caps package 2019-11-14 21:13:16 +02:00
opts enforce reserve internal labels. 2020-02-12 12:03:35 +08:00
patches Remove blurb about fixed in go1.11 in patch file 2020-04-24 11:23:14 -07:00
pkg Merge pull request #41016 from kolyshkin/cgroup-init 2020-07-16 11:26:52 -07:00
plugin Configure shims from runtime config 2020-07-13 14:18:02 -07:00
profiles seccomp: allow 'rseq' syscall in default seccomp profile 2020-06-26 16:06:26 +02:00
project project: remove obviously outdated docs 2020-06-24 19:58:25 +09:00
reference fix goimports 2020-02-11 22:16:54 +09:00
registry registry: fix mtls config dir passing 2020-05-14 12:02:09 -07:00
reports
restartmanager
rootless rootless: support `--exec-opt native.cgroupdriver=systemd` 2020-02-14 15:32:31 +09:00
runconfig pkg/sysinfo: rm duplicates 2020-06-26 16:19:52 -07:00
testutil Upgrading the versions of images in Dockerfile. 2020-06-30 12:24:06 +08:00
vendor Merge pull request #41189 from thaJeztah/bump_libnetwork 2020-07-13 15:51:39 +02:00
volume SELinux: fix ENOTSUP errors not being detected when relabeling 2020-05-10 17:06:44 +02:00
.DEREK.yml
.dockerignore update .dockerignore to prevent '-unsupported' builds 2020-01-13 12:55:15 +01:00
.gitignore Use -X ldflags to set dockerversion package vars 2019-12-02 10:21:41 -08:00
.mailmap Update mailmap and authors 2019-09-30 19:12:18 +02:00
AUTHORS Update mailmap and authors 2019-09-30 19:12:18 +02:00
CHANGELOG.md
CONTRIBUTING.md
Dockerfile Bump Go 1.13.13 2020-07-15 14:21:41 +09:00
Dockerfile.buildx Bump Go 1.13.13 2020-07-15 14:21:41 +09:00
Dockerfile.e2e Bump Go 1.13.13 2020-07-15 14:21:41 +09:00
Dockerfile.simple Bump Go 1.13.13 2020-07-15 14:21:41 +09:00
Dockerfile.windows Bump Go 1.13.13 2020-07-15 14:21:41 +09:00
Jenkinsfile hack: add more debugging to understand exit codepath 2020-05-27 23:40:11 +00:00
LICENSE
MAINTAINERS Add myself as a curator 2020-01-09 15:03:38 -05:00
Makefile Makefile: remove empty targets, and slight refactor 2020-05-01 16:48:07 +02:00
NOTICE
README.md
ROADMAP.md
SECURITY.md
TESTING.md fix typos and grammar in docs 2020-06-26 17:30:59 -06:00
VENDORING.md
codecov.yml
poule.yml
vendor.conf Merge pull request #41189 from thaJeztah/bump_libnetwork 2020-07-13 15:51:39 +02:00

README.md

The Moby Project

Moby Project logo

Moby is an open-source project created by Docker to enable and accelerate software containerization.

It provides a "Lego set" of toolkit components, the framework for assembling them into custom container-based systems, and a place for all container enthusiasts and professionals to experiment and exchange ideas. Components include container build tools, a container registry, orchestration tools, a runtime and more, and these can be used as building blocks in conjunction with other tools and projects.

Principles

Moby is an open project guided by strong principles, aiming to be modular, flexible and without too strong an opinion on user experience. It is open to the community to help set its direction.

  • Modular: the project includes lots of components that have well-defined functions and APIs that work together.
  • Batteries included but swappable: Moby includes enough components to build fully featured container system, but its modular architecture ensures that most of the components can be swapped by different implementations.
  • Usable security: Moby provides secure defaults without compromising usability.
  • Developer focused: The APIs are intended to be functional and useful to build powerful tools. They are not necessarily intended as end user tools but as components aimed at developers. Documentation and UX is aimed at developers not end users.

Audience

The Moby Project is intended for engineers, integrators and enthusiasts looking to modify, hack, fix, experiment, invent and build systems based on containers. It is not for people looking for a commercially supported system, but for people who want to work and learn with open source code.

Relationship with Docker

The components and tools in the Moby Project are initially the open source components that Docker and the community have built for the Docker Project. New projects can be added if they fit with the community goals. Docker is committed to using Moby as the upstream for the Docker Product. However, other projects are also encouraged to use Moby as an upstream, and to reuse the components in diverse ways, and all these uses will be treated in the same way. External maintainers and contributors are welcomed.

The Moby project is not intended as a location for support or feature requests for Docker products, but as a place for contributors to work on open source code, fix bugs, and make the code more useful. The releases are supported by the maintainers, community and users, on a best efforts basis only, and are not intended for customers who want enterprise or commercial support; Docker EE is the appropriate product for these use cases.


Legal

Brought to you courtesy of our legal counsel. For more context, please see the NOTICE document in this repo.

Use and transfer of Moby may be subject to certain restrictions by the United States and other governments.

It is your responsibility to ensure that your use and/or transfer does not violate applicable laws.

For more information, please see https://www.bis.doc.gov

Licensing

Moby is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.