Commit graph

36925 commits

Author SHA1 Message Date
Justin Cormack
2df693e533
Entropy cannot be saved
Remove non cryptographic randomness.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2019-06-07 11:54:45 +01:00
Kirill Kolyshkin
1d5748d975
Merge pull request #39173 from olljanat/25885-capabilities-swarm
Add support for capabilities options in services
2019-06-06 15:03:46 -07:00
Brian Goff
cf406eb359
Merge pull request #39307 from kolyshkin/aufs-reinstate-mntL
Revert "aufs: remove mntL"
2019-06-06 11:22:16 -07:00
Brian Goff
4961f30d88
Merge pull request #39325 from thaJeztah/harden_TestPsListContainersFilterExited
Harden TestPsListContainersFilterExited
2019-06-06 11:21:34 -07:00
Akihiro Suda
e0fefb9a7f
Merge pull request #39309 from thaJeztah/fix_api_history2
Move cgroup info changes to API v1.40
2019-06-06 13:39:35 +09:00
Tõnis Tiigi
db18c6f133
Merge pull request #39318 from thaJeztah/fix_typo
Fix typo retreive -> retrieve
2019-06-05 16:31:11 -07:00
Sebastiaan van Stijn
915acffdb4
Harden TestPsListContainersFilterExited
This test runs on a daemon also used by other tests
so make sure we don't get failures if another test
doesn't cleanup or is running in parallel.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-05 17:02:44 +02:00
Sebastiaan van Stijn
71e00574c7
Merge pull request #39279 from ZYecho/fix-swagger-copy
fix: fix lack of copyUIDGID in swagger.yaml
2019-06-05 13:13:59 +02:00
Sebastiaan van Stijn
55ad894d63
Merge pull request #39320 from microsoft/jjh/39290alternate
Windows: Don't attempt detach VHD for R/O layers
2019-06-05 12:25:40 +02:00
zhangyue
a4f828cb89 fix: fix lack of copyUIDGID in swagger.yaml
Signed-off-by: Zhang Yue <zy675793960@yeah.net>
Signed-off-by: zhangyue <zy675793960@yeah.net>
2019-06-05 09:58:04 +08:00
John Howard
293c74ba79 Windows: Don't attempt detach VHD for R/O layers
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-06-04 13:38:52 -07:00
Sebastiaan van Stijn
a6e1502575
Merge pull request #39295 from tiborvass/buildkit-systemd-resolvconf
build: buildkit now also uses systemd's resolv.conf
2019-06-04 20:28:36 +02:00
Sebastiaan van Stijn
bd89b3f553
Merge pull request #39288 from dohse/do-not-order-uid-gid-mappings
Stop sorting uid and gid ranges in id maps
2019-06-04 20:12:30 +02:00
Sebastiaan van Stijn
a74eb9c36b
Merge pull request #39308 from thaJeztah/fix_clone_seccomp_cgroupns
Fix seccomp profile for clone syscall
2019-06-04 20:11:15 +02:00
Tibor Vass
54043d2f6f
Merge pull request #39281 from dperny/vendor-swarmkit
Revert docker/swarmkit#2804
2019-06-04 10:28:42 -07:00
Tibor Vass
18a4498c2d
Merge pull request #39306 from dperny/increase-swarmkit-grpc
Increase max recv gRPC message size for nodes and secrets
2019-06-04 09:32:24 -07:00
Akihiro Suda
364f9bce16
Merge pull request #39292 from cpuguy83/root_dir_on_copy
Pass root to chroot to for chroot Tar/Untar (CVE-2018-15664)
2019-06-05 01:05:29 +09:00
Tibor Vass
8ff4ec98cf build: buildkit now also uses systemd's resolv.conf
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-06-04 16:04:10 +00:00
Tibor Vass
2e58093662
Merge pull request #39315 from tonistiigi/update-buildkit
vendor: update buildkit to 37d53758
2019-06-04 08:59:12 -07:00
Tibor Vass
574270cf50
Merge pull request #39310 from tiborvass/fix-build-panic
build: fix panic when exporting to tar
2019-06-04 08:54:29 -07:00
Sebastiaan van Stijn
539e72f75b
Fix typo retreive -> retrieve
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-04 17:33:04 +02:00
Sebastiaan van Stijn
a1ec8551ab
Fix seccomp profile for clone syscall
All clone flags for namespace should be denied.

Based-on-patch-by: Kenta Tada <Kenta.Tada@sony.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-04 15:28:12 +02:00
Sebastiaan van Stijn
c13dab6bd8
Merge pull request #39312 from cpuguy83/binddir_cache
Set DOCKER_BINDDIR mount options from env
2019-06-04 13:41:52 +02:00
Tonis Tiigi
85bbbd4495 vendor: update buildkit to 37d53758
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-06-04 00:34:16 -07:00
Brian Goff
b1e6536ceb Set DOCKER_BINDDIR mount options from env
Adds `DOCKER_BINDDIR_MOUNT_OPTS` to easily tweak the BINDDIR mount
options... primarily adding so I can control the caching mode for
osxfs because compiling takes > 1min for me with the default and < 30s
with both `cached` and `delegated`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-06-03 16:16:48 -07:00
Tibor Vass
6104eb1ae2 build: fix panic when exporting to tar
Fixes a panic on `docker build -t foo -o - . >/dev/null`

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-06-03 22:34:15 +00:00
Sebastiaan van Stijn
16e04da4cb
Move cgroup info changes to API v1.40
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-03 22:50:47 +02:00
Sebastiaan van Stijn
3d21b86e0a
Merge pull request #39299 from AkihiroSuda/ro-none-cgroupdriver
info: report cgroup driver as "none" when running rootless
2019-06-03 22:46:08 +02:00
Kir Kolyshkin
5020edca76 Revert "aufs: remove mntL"
Commit e2989c4d48 says:

> With the suffix added, the possibility to hit the race is extremely
> low, and we don't have to do any locking.

Probability theory just laughed in my face this weekend, as this has
actually happened once in 6050000 containers created, on a high-end
hardware with 1000 parallel "docker create" running (took a few days).

One way to work around this is increase the randomness by adding more
characters, which will further decrease the probability, but won't
eliminate it entirely. Another is to fix it upstream (done, see the
link below, but the fix might not be packported to Ubuntu).

Overall, as much as I like this solution, I think we need to
revert it :-\

See-also: https://github.com/sfjro/aufs5-standalone/commit/abf61326f49535

This reverts commit e2989c4d48.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-06-03 10:42:45 -07:00
Brian Goff
3029e765e2 Add chroot for tar packing operations
Previously only unpack operations were supported with chroot.
This adds chroot support for packing operations.
This prevents potential breakouts when copying data from a container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-06-03 09:45:29 -07:00
Brian Goff
d089b63937 Pass root to chroot to for chroot Untar
This is useful for preventing CVE-2018-15664 where a malicious container
process can take advantage of a race on symlink resolution/sanitization.

Before this change chrootarchive would chroot to the destination
directory which is attacker controlled. With this patch we always chroot
to the container's root which is not attacker controlled.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-06-03 09:45:21 -07:00
Drew Erny
a0903e1fa3 Increase max recv gRPC message size for nodes and secrets
Increases the max recieved gRPC message size for Node and Secret list
operations. This has already been done for the other swarm types, but
was not done for these.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2019-06-03 11:42:31 -05:00
Jonas Dohse
c4628d79d2 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>
2019-06-03 15:50:26 +02:00
Akihiro Suda
ca5aab19b4 rootless: update docker info docs
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-06-03 19:41:50 +09:00
Sebastiaan van Stijn
0105613eb2
Merge pull request #39259 from olljanat/fix-win-tmp
Windows CI - Corrected LOCALAPPDATA location
2019-06-03 11:12:42 +02:00
Yong Tang
784bd2c883
Merge pull request #39248 from dontub/fix-api-operation-PutContainerArchive
API: Set format of body parameter in operation PutContainerArchive to "binary"
2019-06-02 12:56:15 -07:00
Yong Tang
acdbaaa3ed
Merge pull request #39204 from olljanat/fix-hostname-dns-resolution
Add alias for hostname if hostname != container name
2019-06-02 09:48:37 -07:00
Akihiro Suda
153466ba0a info: report cgroup driver as "none" when running rootless
Previously `docker info` had reported "cgroupfs" as the cgroup driver
but the driver wasn't actually used at all.

This PR reports "none" as the cgroup driver so as to avoid confusion.
e.g. kubeadm/kubelet will detect cgroupless-ness by checking this docker
info field. https://github.com/rootless-containers/usernetes/pull/97

Note that user still cannot specify `native.cgroupdriver=none` manually.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-06-03 00:11:21 +09:00
Olli Janatuinen
61815f6763 Windows CI - Corrected LOCALAPPDATA location
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-05-29 23:44:40 +03:00
Drew Erny
c7d9599e3d Revert docker/swarmkit#2804
Reverts the change to swarmkit that made all updates set UpdateStatus to
Completed

Signed-off-by: Drew Erny <drew.erny@docker.com>
2019-05-29 12:54:39 -05:00
Yong Tang
8d760280a2
Merge pull request #39275 from wiktor-k/move-var-run-to-run
Change socket location to /run/docker.sock
2019-05-29 09:39:06 -07:00
Wiktor Kwapisiewicz
8abf26dbfb
Change docker socket location to /run/docker.sock
This change resolves the following systemd warning:

```
/usr/lib/systemd/system/docker.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/docker.sock → /run/docker.sock; please update the unit file accordingly.
```

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
2019-05-28 23:22:54 +02:00
Sebastiaan van Stijn
b1239f0a9f
Merge pull request #39277 from olljanat/fix-code-on-master
Fix to gofmt/goimports errors
2019-05-28 22:27:56 +03:00
Olli Janatuinen
14280fdc62 Fix to gofmt/goimports errors
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-05-28 20:32:27 +03:00
Olli Janatuinen
f787b235de Add support capabilities list on services
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-05-28 19:52:36 +03:00
Brian Goff
cefc60ccfa
Merge pull request #39255 from thaJeztah/fix_windows_errortype
Windows: fix error-type for starting a running container
2019-05-28 09:46:51 -07:00
Sebastiaan van Stijn
c7a0eaf004
Merge pull request #39242 from arkodg/lb-stale-force-leave
Network not deleted after stack is removed
2019-05-28 00:31:55 +03:00
Kirill Kolyshkin
6899fc094e
Merge pull request #39203 from slar/master
fixes #39145: Correct copy paste mistage in pkg/mount/mountinfo_freebsd.go that cau…
2019-05-26 11:36:24 -07:00
Yong Tang
c2c79edfab
Merge pull request #39269 from dperny/bump-swarmkit-vendor
Bump swarmkit vendoring
2019-05-26 07:42:55 -07:00
Sebastiaan van Stijn
f25e0c6f30
Merge pull request #39209 from kolyshkin/mountedLayer.Lock
layer: fix same rw layer races
2019-05-25 22:30:55 +02:00