Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
Go to file
Sebastiaan van Stijn e5ae83e503
volumes: only send "create" event when actually creating volume
The VolumesService did not have information wether or not a volume
was _created_ or if a volume already existed in the driver, and
the existing volume was used.

As a result, multiple "create" events could be generated for the
same volume. For example:

1. Run `docker events` in a shell to start listening for events
2. Create a volume:

    docker volume create myvolume

3. Start a container that uses that volume:

    docker run -dit -v myvolume:/foo busybox

4. Check the events that were generated:

    2021-02-15T18:49:55.874621004+01:00 volume create myvolume (driver=local)
    2021-02-15T18:50:11.442759052+01:00 volume create myvolume (driver=local)
    2021-02-15T18:50:11.487104176+01:00 container create 45112157c8b1382626bf5e01ef18445a4c680f3846c5e32d01775dddee8ca6d1 (image=busybox, name=gracious_hypatia)
    2021-02-15T18:50:11.519288102+01:00 network connect a19f6bb8d44ff84d478670fa4e34c5bf5305f42786294d3d90e790ac74b6d3e0 (container=45112157c8b1382626bf5e01ef18445a4c680f3846c5e32d01775dddee8ca6d1, name=bridge, type=bridge)
    2021-02-15T18:50:11.526407799+01:00 volume mount myvolume (container=45112157c8b1382626bf5e01ef18445a4c680f3846c5e32d01775dddee8ca6d1, destination=/foo, driver=local, propagation=, read/write=true)
    2021-02-15T18:50:11.864134043+01:00 container start 45112157c8b1382626bf5e01ef18445a4c680f3846c5e32d01775dddee8ca6d1 (image=busybox, name=gracious_hypatia)

5. Notice that a "volume create" event is created twice;

    - once when `docker volume create` was ran
    - once when `docker run ...` was ran

This patch moves the generation of (most) events to the volume _store_, and only
generates an event if the volume did not yet exist.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-05-05 16:02:22 +02:00
.github
api Remove more of registry v1 code. 2021-02-23 09:49:46 +01:00
builder builder: produce error when using unsupported Dockerfile option 2021-03-14 14:11:08 +01:00
cli
client Update documentation links 2021-02-25 12:11:50 +01:00
cmd/dockerd Use designated test domains (RFC2606) in tests 2021-04-02 14:06:27 +02:00
container replace pkg/symlink with github.com/moby/sys/symlink 2020-11-03 11:17:12 +01:00
contrib Merge pull request #42077 from WhyNotHugo/patch-1 2021-05-03 10:36:03 -07:00
daemon Added missing test cleanup for temporary directory 2021-05-01 15:39:50 +03:00
distribution distribution: fix errors tests 2021-02-23 09:49:49 +01:00
dockerversion
docs Fix typo on the v1.41 changelog 2021-04-07 22:29:07 +02:00
errdefs Implement Unwrap to errors 2020-11-21 16:36:35 +01:00
hack hack/dind: fix cgroup v2 evacuation with `docker run --init` 2021-04-28 13:30:10 +09:00
image Merge pull request #41884 from rcowsill/41829-load-valid-parent 2021-02-22 22:00:29 +01:00
integration volumes: only send "create" event when actually creating volume 2021-05-05 16:02:22 +02:00
integration-cli volumes: only send "create" event when actually creating volume 2021-05-05 16:02:22 +02:00
internal/test/suite
layer fix typo in comments 2021-03-02 23:03:04 +08:00
libcontainerd Prepare tests for Windows containerd support 2021-04-22 10:50:00 +03:00
oci oci.Device() fix FileMode to match runtime spec 2021-02-18 10:48:24 +01:00
opts opts: unify host-options, and use consts 2020-10-31 16:44:21 +01:00
patches
pkg pkg/archive temporarily skip some tests on Windowsd V19H1 (1903) and up 2021-04-09 01:07:27 +02:00
plugin Use docker media type for plugin layers 2021-04-05 21:46:53 +00:00
profiles Enable `process_vm_readv` and `process_vm_writev` for kernel > 4.8 2021-03-04 17:12:01 +00:00
project vendor: opencontainers/selinux v1.8.0, and remove selinux build-tag and stubs 2020-12-24 00:47:16 +01:00
quota
reference
registry Use designated test domains (RFC2606) in tests 2021-04-02 14:06:27 +02:00
reports
restartmanager
rootless Merge pull request #41893 from AkihiroSuda/fix-41457 2021-04-06 14:30:40 +09:00
runconfig
testutil Merge pull request #41817 from simonferquel/desktop-startup-hang 2020-12-23 23:22:00 -08:00
vendor Update Microsoft/go-winio to version 0.4.19 2021-04-26 10:02:58 -07:00
volume volumes: only send "create" event when actually creating volume 2021-05-05 16:02:22 +02:00
.DEREK.yml
.dockerignore
.gitignore
.mailmap
AUTHORS
CHANGELOG.md
CONTRIBUTING.md
Dockerfile Dockerfile: update yamllint to v1.26.1 to fix build 2021-04-15 21:30:10 +02:00
Dockerfile.buildx Dockerfile.buildx: update buildx to v0.5.1 2021-01-26 11:37:50 +01:00
Dockerfile.e2e Move use of debian:buster frozen image to debian:bullseye 2020-12-19 17:59:36 +01:00
Dockerfile.simple Dockerfile.simple: Fix compile docker binary error with btrfs 2021-02-03 23:16:15 +00:00
Dockerfile.windows
Jenkinsfile Jenkinsfile: temporarily use insider build for Windows 2022 (SAC) 2021-04-08 21:25:35 +02:00
LICENSE
MAINTAINERS Merge pull request #42348 from thaJeztah/crosbymichael_alumni 2021-05-04 16:21:19 +02:00
Makefile
NOTICE
README.md
ROADMAP.md
SECURITY.md
TESTING.md TESTING.md: note that integration-cli is deprecated 2020-12-18 07:51:46 +01:00
VENDORING.md
codecov.yml
poule.yml
vendor.conf Update Microsoft/go-winio to version 0.4.19 2021-04-26 10:02:58 -07: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.