The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
Find a file
Jonas Dohse 601f11300e
Stop sorting uid and gid ranges in id maps
Moby currently sorts uid and gid ranges in id maps. This causes subuid
and subgid files to be interpreted wrongly.

The subuid file

```
> cat /etc/subuid
jonas:100000:1000
jonas:1000:1
```

configures that the container uids 0-999 are mapped to the host uids
100000-100999 and uid 1000 in the container is mapped to uid 1000 on the
host. The expected uid_map is:

```
> docker run ubuntu cat /proc/self/uid_map
         0     100000       1000
      1000       1000          1
```

Moby currently sorts the ranges by the first id in the range. Therefore
with the subuid file above the uid 0 in the container is mapped to uid
100000 on host and the uids 1-1000 in container are mapped to the uids
1-1000 on the host. The resulting uid_map is:

```
> docker run ubuntu cat /proc/self/uid_map
         0       1000          1
         1     100000       1000
```

The ordering was implemented to work around a limitation in Linux 3.8.
This is fixed since Linux 3.9 as stated on the user namespaces manpage
[1]:

> In the initial implementation (Linux 3.8), this requirement was
> satisfied by a simplistic implementation that imposed the further
> requirement that the values in both field 1 and field 2 of successive
> lines must be in ascending numerical order, which prevented some
> otherwise valid maps from being created.  Linux 3.9 and later fix this
> limitation, allowing any valid set of nonoverlapping maps.

This fix changes the interpretation of subuid and subgid files which do
not have the ids of in the numerical order for each individual user.
This breaks users that rely on the current behaviour.

The desired mapping above - map low user ids in the container to high
user ids on the host and some higher user ids in the container to lower
user on host - can unfortunately not archived with the current
behaviour.

[1] http://man7.org/linux/man-pages/man7/user_namespaces.7.html

Signed-off-by: Jonas Dohse <jonas@dohse.ch>
(cherry picked from commit c4628d79d2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-05 14:46:31 +02:00
.github Remove myself from CODEOWNERS 2018-03-26 13:45:05 -04:00
api Fix some typos 2019-04-17 21:32:10 +02:00
builder builder-next: call stopprogress on download error 2019-05-20 15:26:49 +02:00
cli Various code-cleanup 2018-05-23 17:50:54 +02:00
client Merge pull request #198 from thaJeztah/18.09_backport_test_updates 2019-04-23 09:49:55 -07:00
cmd/dockerd Fix some typos 2019-04-17 21:32:10 +02:00
container Ignore xattr ENOTSUP errors on copy (fixes #38155) 2019-02-09 11:04:09 +01:00
contrib Add CONFIG_IP_VS_PROTO_TCP, CONFIG_IP_VS_PROTO_UDP, IP_NF_TARGET_REDIRECT to check-config.sh 2018-11-20 18:08:44 +01:00
daemon Add chroot for tar packing operations 2019-06-03 18:55:00 +02:00
distribution Improve 'no matching manifest' error 2019-04-18 18:05:04 +02:00
dockerversion Remove version-checks for containerd and runc 2018-10-05 12:35:59 +02:00
docs Add "Warnings" to /info endpoint, and move detection to the daemon 2018-08-21 11:36:15 +02:00
errdefs Fix the several typos detected by github.com/client9/misspell 2018-08-09 00:45:00 +09:00
hack [18.09] Backport Forcing a nil IP specified in PortBindings to IPv4 zero (0.0.0.0). 2019-05-21 08:31:55 -04:00
image system: add back lcow validation function 2018-06-27 15:24:26 -07:00
integration TestDaemonRestartIpcMode: modernize 2019-04-17 23:09:51 +02:00
integration-cli Use current windows servercore image 2019-04-18 18:06:44 +02:00
internal integration-cli/Test*Swarm*: use same args on restart 2019-04-17 23:09:23 +02:00
layer layer/layer_store: ensure NewInputTarStream resources are released 2019-03-01 23:14:27 +01:00
libcontainerd Fix nil pointer derefence on failure to connect to containerd 2019-02-22 13:22:29 +01:00
migrate/v1 Various code-cleanup 2018-05-23 17:50:54 +02:00
oci Masked /proc/asound 2018-11-30 14:57:51 +01:00
opts Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
pkg Stop sorting uid and gid ranges in id maps 2019-06-05 14:46:31 +02:00
plugin Use assert.NilError() instead of assert.Assert() 2019-04-17 23:08:54 +02:00
profiles apparmor: allow receiving of signals from 'docker kill' 2018-11-21 22:13:56 +01:00
project Remove references to old release process 2018-05-18 18:28:43 +00:00
reference Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
registry registry: use len(via)!=0 instead of via!=nil 2018-12-12 18:12:01 +01:00
reports Fix typos 2018-05-16 09:15:43 +08:00
restartmanager Add canonical import comment 2018-02-05 16:51:57 -05:00
runconfig Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
vendor [18.09] Backport Forcing a nil IP specified in PortBindings to IPv4 zero (0.0.0.0). 2019-05-21 08:31:55 -04:00
volume Use assert.NilError() instead of assert.Assert() 2019-04-17 23:08:54 +02:00
.DEREK.yml project: try alexellis/derek bot to manage PRs and issues 2017-12-04 16:11:41 +01:00
.dockerignore [EXPERIMENTAL] Integration Test on Swarm 2017-02-28 02:10:09 +00:00
.gitignore Add code coverage report and codecov config 2018-01-16 16:50:56 -05:00
.mailmap Update authors and mailmap 2018-05-21 01:07:22 +02:00
AUTHORS Update authors and mailmap 2018-05-21 01:07:22 +02:00
CHANGELOG.md Fix some typos 2019-04-17 21:32:10 +02:00
codecov.yml Add code coverage report and codecov config 2018-01-16 16:50:56 -05:00
CONTRIBUTING.md Fix link anchors in CONTRIBUTING.md 2018-06-13 21:58:48 +09:00
Dockerfile Revert "Merge pull request #240 from seemethere/bundle_me_up_1809" 2019-02-23 01:49:12 +01:00
Dockerfile.e2e [18.09] Bump Golang 1.10.8 (CVE-2019-6486) 2019-02-09 11:05:52 +01:00
Dockerfile.simple [18.09] Bump Golang 1.10.8 (CVE-2019-6486) 2019-02-09 11:05:52 +01:00
Dockerfile.windows [18.09] Bump Golang 1.10.8 (CVE-2019-6486) 2019-02-09 11:05:52 +01:00
LICENSE Update copyright dates 2017-02-24 19:41:59 +00:00
MAINTAINERS Fix the several typos detected by github.com/client9/misspell 2018-08-09 00:45:00 +09:00
Makefile hack: no need to git fetch in CI 2019-02-18 11:19:49 +01:00
NOTICE Update LICENSE date 2017-02-15 17:34:33 +01:00
poule.yml Add myself to poule to get 2w/old PRs 2018-04-16 18:33:21 +02:00
README.md Add "Lego set" back in README.md 2017-10-10 14:10:39 +00:00
ROADMAP.md Update the Roadmap 2017-10-11 17:33:50 +01:00
TESTING.md Merge pull request #37249 from AntaresS/add-test-guidline 2018-06-25 20:44:42 +02:00
vendor.conf [18.09] Backport Forcing a nil IP specified in PortBindings to IPv4 zero (0.0.0.0). 2019-05-21 08:31:55 -04:00
VENDORING.md fix the bare url and the Summary of http://semver.org 2017-01-17 16:20:11 +08:00

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.