Commit graph

35902 commits

Author SHA1 Message Date
Xiaoxi He
0b46144ff7
Fix some typos
Signed-off-by: Xiaoxi He <xxhe@alauda.io>
(cherry picked from commit 5c0d2a0932)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 21:32:10 +02:00
Sebastiaan van Stijn
1c4d9ccda6
Merge pull request #187 from thaJeztah/18.09_bump_buildkit
[18.09] bump buildkit ed4da8b4a9661f278ae8433056ca37d0727c408b (docker-18.09 branch)
2019-04-12 23:15:11 +02:00
Andrew Hsu
50ebe4562d
Merge pull request #192 from mavenugo/18.09_ln_vndr
[18.09 backport] Vendor Libnetwork c902989
2019-04-08 08:09:54 -07:00
Madhu Venugopal
a9e2f27bf0 Vendor Libnetwork c902989
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2019-04-07 09:37:15 -07:00
Sebastiaan van Stijn
083da4862d
bump buildkit ed4da8b4a9661f278ae8433056ca37d0727c408b (docker-18.09 branch)
brings in moby/buildkit#911 [docker-18.09] llbsolver: fix selectors dedupe
(backport of https://github.com/moby/buildkit/pull/858)

fixes https://github.com/moby/moby/issues/38964

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-29 01:41:32 +01:00
Andrew Hsu
1046c63711
Merge pull request #185 from thaJeztah/18.09_backport_fix_leaking_task_resources
[18.09] bump docker/swarmkit 19e791fd6dc76e8e894cbc99 (18.09 branch)
2019-03-28 16:58:46 -07:00
Sebastiaan van Stijn
c362380363
bump docker/swarmkit 19e791fd6dc76e8e894cbc99b77f946b7d00ebb9 (18.09 branch)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-28 22:06:24 +01:00
Andrew Hsu
80e10316cd
Merge pull request #180 from thaJeztah/18.09_backport_fix_net_host_systemd_resolved
[18.09 backport] Fix: network=host using wrong resolv.conf with systemd-resolved
2019-03-28 10:17:58 -07:00
Andrew Hsu
8c0845a508
Merge pull request #176 from AkihiroSuda/38902-1809
[18.09 backport] builder-next: fix squash
2019-03-28 09:38:37 -07:00
Andrew Hsu
b4bf217633
Merge pull request #178 from thaJeztah/18.09_backport_exec_spec
[18.09 backport] Use original process spec for execs
2019-03-28 09:37:29 -07:00
Andrew Hsu
160b62e7a5
Merge pull request #181 from thaJeztah/18.09_backport_fix_stopped_restart_containers
[18.09 backport] Fix stopped containers with restart-policy showing as "restarting"
2019-03-28 09:10:59 -07:00
Sebastiaan van Stijn
200b524eff
Merge pull request #183 from thaJeztah/18.09_backport_gitutils
[18.09 backport] gitutils: add validation for ref
2019-03-27 09:34:06 +01:00
Tonis Tiigi
37ec11c8e3
gitutils: add validation for ref
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 723b107ca4fba14580a6cd971e63d8af2e7d2bbe)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit a588898f99)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-26 23:34:28 +01:00
Sebastiaan van Stijn
00f0b9df0d
Fix stopped containers with restart-policy showing as "restarting"
When manually stopping a container with a restart-policy, the container
would show as "restarting" in `docker ps` whereas its actual state
is "exited".

Stopping a container with a restart policy shows the container as "restarting"

    docker run -d --name test --restart unless-stopped busybox false

    docker stop test

    docker ps
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS               NAMES
    7e07409fa1d3        busybox             "false"             5 minutes ago       Restarting (1) 4 minutes ago                     test

However, inspecting the same container shows that it's exited:

    docker inspect test --format '{{ json .State }}'
    {
      "Status": "exited",
      "Running": false,
      "Paused": false,
      "Restarting": false,
      "OOMKilled": false,
      "Dead": false,
      "Pid": 0,
      "ExitCode": 1,
      "Error": "",
      "StartedAt": "2019-02-14T13:26:27.6091648Z",
      "FinishedAt": "2019-02-14T13:26:27.689427Z"
    }

And killing the container confirms this;

    docker kill test
    Error response from daemon: Cannot kill container: test: Container 7e07409fa1d36dc8d8cb8f25cf12ee1168ad9040183b85fafa73ee2c1fcf9361 is not running

    docker run -d --name test --restart unless-stopped busybox false

    docker stop test

    docker ps
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                PORTS               NAMES
    d0595237054a        busybox             "false"             5 minutes ago       Restarting (1)       4 minutes ago                       exit

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8c0ecb6387)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-26 14:17:52 +01:00
Sebastiaan van Stijn
04ae160eca
Fix: network=host using wrong resolv.conf with systemd-resolved
When running a container in the host's network namespace, the container
gets a copy of the host's resolv.conf (copied to `/etc/resolv.conf` inside
the container).

The current code always used the default (`/etc/resolv.conf`) path on the
host, irregardless if `systemd-resolved` was used or not.

This patch uses the correct file if `systemd-resolved` was detected
to be running.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8364d1c9d5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-26 12:55:53 +01:00
Michael Crosby
3d3d757071
Use original process spec for execs
Fixes #38865

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 7603c22c73)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-26 12:37:59 +01:00
Akihiro Suda
8d87a2a4bc builder-next: fix squash
Tagger was not called for BuildKit-mode.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit 7fc0f820ea)
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-21 21:34:49 +09:00
Andrew Hsu
6e2e248bdf
Merge pull request #173 from thaJeztah/18.09_backport_bump_containerd_1.2.5
[18.09 backport] Update containerd v1.2.5, runc 2b18fe1d885ee5 binaries
2019-03-20 11:01:06 -07:00
Andrew Hsu
1782e74e54
Merge pull request #175 from thaJeztah/18.09_backport_fix_testrunbindmounts
[18.09 backport] Windows (pre RS5) disableTestRunBindMounts
2019-03-20 09:27:32 -07:00
John Howard
91703956df
Windows (pre RS5) disableTestRunBindMounts
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 9d2e97ac6e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-20 10:58:15 +01:00
Tibor Vass
fdaec73c1c
Merge pull request #174 from thaJeztah/18.09_backport_fixrunuserdefaults
[18.09 backport] Windows:Fix TestRunUserDefaults
2019-03-19 20:10:24 -07:00
John Howard
fd4670161d
Windows:Fix TestRunUserDefaults
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 80fce6d747)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-19 21:18:53 +01:00
Sebastiaan van Stijn
a36f6bfc36
vendor containerd/cgroups dbea6f2bd41658b84b00417ceefa416b979cbf10
Relevant changes:

- containerd/containerd#51 Fix empty device type
- containerd/containerd#52 Remove call to unitName
  - Calling unitName incorrectly appends -slice onto the end of the slice cgroup we are looking for
  - addresses containerd/containerd#47 cgroups: cgroup deleted
- containerd/containerd#53 systemd-239+ no longer allows delegate slice
- containerd/containerd#54 Bugfix: can't write to cpuset cgroup
- containerd/containerd#63 Makes Load function more lenient on subsystems' checking
  - addresses containerd/containerd#58 Very strict checking of subsystems' existence while loading cgroup
- containerd/containerd#67 Add functionality for retrieving all tasks of a cgroup
- containerd/containerd#68 Fix net_prio typo
- containerd/containerd#69 Blkio weight/leafWeight pointer value
- containerd/containerd#77 Check for non-active/supported cgroups
  - addresses containerd/containerd#76 unable to find * in controller set: unknown
  - addresses docker/for-linux#545 Raspbian: Error response from daemon: unable to find "net_prio" in controller set: unknown
  - addresses docker/for-linux#552 Error response from daemon: unable to find "cpuacct" in controller set: unknown
  - addresses docker/for-linux#545 Raspbian: Error response from daemon: unable to find "net_prio" in controller set: unknown

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 386b06eacd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-15 23:15:14 +01:00
Sebastiaan van Stijn
6c71500862
Update containerd v1.2.5, runc 2b18fe1d885ee5083ef9f0838fee39b62d653e30
Notable Updates

- Fix an issue that non-existent parent directory in image layers is created with permission 0700. containerd#3017
- Fix an issue that snapshots of the base image can be deleted by mistake, when images built on top of it are deleted. containerd#3087
- Support for GC references to content from snapshot and container objects. containerd#3080
- cgroups updated to dbea6f2bd41658b84b00417ceefa416b97 to fix issues for systemd 420 and non-existent cgroups. containerd#3079
- runc updated to 2b18fe1d885ee5083ef9f0838fee39b62d653e30 to include the improved fix for CVE-2019-5736. containerd#3082
- cri: Fix a bug that pod can't get started when the same volume is defined differently in the image and the pod spec. cri#1059
- cri: Fix a bug that causes container start failure after in-place upgrade containerd to 1.2.4+ or 1.1.6+. cri#1082
- cri updated to a92c40017473cbe0239ce180125f12669757e44f. containerd#3084

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 25cdae293f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-15 23:14:54 +01:00
Andrew Hsu
6e84332e53
Merge pull request #170 from thaJeztah/18.09_bump_swarmkit
[18.09] bump swarmkit to c66ed60822d3fc3bf6e17a505ee79014f449ef05 (bump 18.09)
2019-03-12 11:05:48 -07:00
Andrew Hsu
d51db2f20b
Merge pull request #169 from thaJeztah/18.09_bump_libnetwork2
[18.09] bump libnetwork 4725f2163fb (bump_18.09 branch)
2019-03-08 14:45:06 -08:00
Andrew Hsu
c97602ef99
Merge pull request #171 from thaJeztah/18.09_backport_fix_build_session_test
[18.09 backport] Fix TestBuildWithSession, TestBuildSquashParent  using wrong daemon during test
2019-03-08 14:43:42 -08:00
Sebastiaan van Stijn
605bc1ffc5
Fix TestBuildWithSession, TestBuildSquashParent using wrong daemon during test
These tests were spinning up a new daemon, but after the daemon was spun up,
the default test-daemon was used by the client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9a3911ced8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-06 22:11:22 +01:00
Sebastiaan van Stijn
1a60fdbdce
[18.09] bump swarmkit to c66ed60822d3fc3bf6e17a505ee79014f449ef05 (bump 18.09)
relevant changes:

- swarmkit#2826 [18.09 backport] use a custom grpc dialer when managers are joining (backport of swarmkit#2802)
- swarmkit#2801 [18.09 backport] Include old error-message for backward compatibility (backport of swarmkit#2797)
- swarmkit#2788 [18.09 backport] Return correct error-codes on conflicting names (backport of swarmkit#2779)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-06 22:08:48 +01:00
Andrew Hsu
ad59cba5a0
Merge pull request #164 from thaJeztah/18.09_backport_esc_1090
[18.09 backport] set bigger grpc limit for GetConfigs api
2019-03-06 08:14:26 -08:00
Andrew Hsu
e2ddb3a2ff
Merge pull request #166 from thaJeztah/18.09_backport_tarstream_release
[18.09 backport] layer/layer_store: ensure NewInputTarStream resources are released
2019-03-06 08:12:18 -08:00
Andrew Hsu
2f867e6b4c
Merge pull request #167 from thaJeztah/18.09_backport_cp_longname
[18.09 backport] pkg/archive:CopyTo(): fix for long dest filename
2019-03-06 08:07:18 -08:00
Sebastiaan van Stijn
8c51888016
[18.09] bump libnetwork 4725f2163fb (bump_18.09 branch)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-05 22:57:37 +01:00
Kir Kolyshkin
989e7f5d3a
pkg/archive:CopyTo(): fix for long dest filename
As reported in docker/for-linux/issues/484, since Docker 18.06
docker cp with a destination file name fails with the following error:

> archive/tar: cannot encode header: Format specifies USTAR; and USTAR cannot encode Name="a_very_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_long_filename_that_is_101_characters"

The problem is caused by changes in Go 1.10 archive/tar, which
mis-guesses the tar stream format as USTAR (rather than PAX),
which, in turn, leads to inability to specify file names
longer than 100 characters.

This tar stream is sent by TarWithOptions() (which, since we switched to
Go 1.10, explicitly sets format=PAX for every file, see FileInfoHeader(),
and before Go 1.10 it was PAX by default). Unfortunately, the receiving
side, RebaseArchiveEntries(), which calls tar.Next(), mistakenly guesses
header format as USTAR, which leads to the above error.

The fix is easy: set the format to PAX in RebaseArchiveEntries()
where we read the tar stream and change the file name.

A unit test is added to prevent future regressions.

NOTE this code is not used by dockerd, but rather but docker cli
(also possibly other clients), so this needs to be re-vendored
to cli in order to take effect.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit f55a4176fe)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-02 16:33:19 +01:00
Sergio Lopez
f660ef2c25
layer/layer_store: ensure NewInputTarStream resources are released
In applyTar, if the driver's ApplyDiff returns an error, the function
returns early without calling io.Copy.

As a consequence, the resources (a goroutine and some buffers holding
the uncompressed image, the digest, etc...) allocated or referenced by
NewInputTarStream above aren't released, as the worker goroutine only
finishes when it finds EOF or a closed pipe.

Signed-off-by: Sergio Lopez <slp@redhat.com>
(cherry picked from commit 5846db10af)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-01 23:14:27 +01:00
Dani Louca
5f40e17cfd
set bigger grpc limit for GetConfigs api
Signed-off-by: Dani Louca <dani.louca@docker.com>
(cherry picked from commit 3fbbeb703c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-27 19:01:12 +01:00
Andrew Hsu
8c91e9672c
Merge pull request #163 from thaJeztah/18.09_backport_busyboxstage2
[18.09 backport] Windows: Bump busybox to v1.1
2019-02-25 16:29:56 -08:00
John Howard
613c2f27ed
Windows: Bump busybox to v1.1
Signed-off-by: John Howard <jhoward@microsoft.com>

This is a follow-on from https://github.com/moby/moby/pull/38277
but had to be done in a couple of stages to ensure that CI didn't
break. v1.1 of the busybox image is now based on a CMD of "sh"
rather than using an entrypoint. And it also uses the bin directory
rather than `c:\busybox`. This makes it look a lot closer to the
Linux busybox image, and means that a couple of Windows-isms in
CI tests can be reverted back to be identical to their Linux
equivalents.

(cherry picked from commit 561e0f6b7f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-25 10:44:48 +01:00
Andrew Hsu
e4b8756784
Merge pull request #153 from thaJeztah/18.09_backport_update_containerd_1.2.4
[18.09 backport] update containerd 1.2.4, runc 6635b4f
2019-02-23 11:09:18 -08:00
Sebastiaan van Stijn
ffeebb217c
Update containerd runtime 1.2.4
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 26413ede57)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-23 01:49:38 +01:00
Sebastiaan van Stijn
c7fca75c03
Update runc to 6635b4f (fix CVE-2019-5736)
- Fixes a vulnerability in runc that allows a container escape (CVE-2019-5736)
  6635b4f0c6,
- Includes security fix for `runc run --no-pivot` (`DOCKER_RAMDISK=1`):
  28a697cce3
  (NOTE: the vuln is attackable only when `DOCKER_RAMDISK=1` is set && seccomp is disabled)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f03698b69a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-23 01:49:25 +01:00
Sebastiaan van Stijn
88330c9aac
Revert "Merge pull request #240 from seemethere/bundle_me_up_1809"
This reverts commit eb137ff176, reversing
changes made to a79fabbfe8.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-23 01:49:12 +01:00
Andrew Hsu
ba8664cc22
Merge pull request #154 from thaJeztah/18.09_backport_fix_stale_container_on_start
[18.09 backport] Delete stale containerd object on start failure
2019-02-22 13:52:47 -08:00
Tibor Vass
24c6c3eb52
Merge pull request #162 from thaJeztah/18.09_backport_38636_fix_nil_pointer_dereference
[18.09 backport] Fix nil pointer derefence on failure to connect to containerd
2019-02-22 10:34:11 -08:00
Simão Reis
0841c61862
Fix nil pointer derefence on failure to connect to containerd
Signed-off-by: Simão Reis <smnrsti@gmail.com>
(cherry picked from commit 3134161be3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-22 13:22:29 +01:00
Tibor Vass
2e4c5c57c3
Merge pull request #160 from thaJeztah/18.09_backport_add_missing_char_device_mode
[18.09 backport] Graphdriver: fix "device" mode not being detected if "character-device" bit is set
2019-02-21 17:01:40 -08:00
Tibor Vass
db7a8cb7ba
Merge pull request #135 from thaJeztah/18.09_backport_xattr_fix
[18.09 backport] Ignore xattr ENOTSUP errors on copy (fixes #38155)
2019-02-21 15:00:20 -08:00
Andrew Hsu
6b0ba3745d
Merge pull request #143 from thaJeztah/18.09_backport_skip_kmem_tests_on_rhel
[18.09 backport] Skip kernel-memory tests on RHEL/CentOS daemons
2019-02-20 18:23:09 -08:00
Andrew Hsu
5c15222f0f
Merge pull request #158 from thaJeztah/18.09_backport_save_the_environment
[18.09 backport] Fix: plugin-tests discarding current environment
2019-02-20 18:11:25 -08:00
Andrew Hsu
f935add758
Merge pull request #157 from thaJeztah/18.09_backport_fix_test_int
[18.09 backport] make test-integration: use correct dockerd binary
2019-02-20 18:10:26 -08:00