Commit graph

43151 commits

Author SHA1 Message Date
Sebastiaan van Stijn
e53f65a916
pkg/signal: remove DefaultStopSignal const
This const was previously living in pkg/signal, but with that package
being moved to its own module, it didn't make much sense to put docker's
defaults in a generic module.

The const from the "signal" package is currenlty used *both* by the CLI
and the daemon as a default value when creating containers. This put up
some questions:

a. should the default be non-exported, and private to the container
   package? After all, it's a _default_ (so should be used if _NOT_ set).
b. should the client actually setting a default, or instead just omit
   the value, unless specified by the user? having the client set a
   default also means that the daemon cannot change the default value
   because the client (or older clients) will override it.
c. consider defaults from the client and defaults of the daemon to be
   separate things, and create a default const in the CLI.

This patch implements option "a" (option "b" will be done separately,
as it involves the CLI code). This still leaves "c" open as an option,
if the CLI wants to set its own default.

Unfortunately, this change means we'll have to drop the alias for the
deprecated pkg/signal.DefaultStopSignal const, but a comment was left
instead, which can assist consumers of the const to find why it's no
longer there (a search showed the Docker CLI as the only consumer though).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-11 10:31:29 +02:00
Sebastiaan van Stijn
3b316814f9
container: un-export DefaultStopTimeout
It's not used outside of the package itself

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-11 10:05:40 +02:00
Sebastiaan van Stijn
8e0d43dda7
docs/api: add node about concurrency on /system/df endpoint
Commit 135cec5d4d added support for
calling the /system/df endpoint concurrently.

This patch adds a note about this enhancement to the API changes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-10 14:51:27 +02:00
Sebastiaan van Stijn
b88acf7a7a
Merge pull request #42715 from rvolosatovs/shared_disk_usage
Share disk usage computation results between concurrent invocations
2021-08-10 13:51:03 +02:00
Sebastiaan van Stijn
919f2ef764
Merge pull request #42527 from thaJeztah/jenkins_windows_2022_update
Jenkinsfile: update Windows 2022 insider to latest tag (10.0.20348.1)
2021-08-10 10:49:04 +02:00
Sebastiaan van Stijn
f91b0d39ed
Merge pull request #41459 from thaJeztah/caps_refactor
oci/caps: refactor, remove unused code, and improved error messages
2021-08-09 20:12:14 +02:00
Roman Volosatovs
135cec5d4d
daemon,volume: share disk usage computations
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-08-09 19:59:39 +02:00
Roman Volosatovs
5adc29ffe2
daemon: sort imports according to gofmt
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-08-09 19:59:37 +02:00
Sebastiaan van Stijn
4706e1c37d
Jenkinsfile: update Windows 2022 insider to latest tag (10.0.20348.1)
Tags can be found at https://mcr.microsoft.com/v2/windows/servercore/insider/tags/list

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-09 17:57:42 +02:00
Sebastiaan van Stijn
b1f7ffea9f
Update Go to 1.16.7
go1.16.7 (released 2021-08-05) includes a security fix to the net/http/httputil
package, as well as bug fixes to the compiler, the linker, the runtime, the go
command, and the net/http package. See the Go 1.16.7 milestone on the issue
tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.16.7+label%3ACherryPickApproved

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 18:14:58 +02:00
Sebastiaan van Stijn
91dc595e96
Merge pull request #42716 from rvolosatovs/discard_type_pre_1_42
API: discard `/system/df` `type` parameter pre-1.42
2021-08-07 15:46:03 +02:00
Sebastiaan van Stijn
27aaadb710
daemon: normalize seccomp profile as part of setupSeccompProfile()
This makes sure that the value set in the daemon can be used as-is,
without having to replicate the normalization logic elsewhere.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 15:41:46 +02:00
Sebastiaan van Stijn
04f932ac86
daemon: move custom seccomp profile warning from CLI to daemon side
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 15:41:44 +02:00
Sebastiaan van Stijn
f8795ed364
daemon: allow "builtin" as valid value for seccomp profiles
This allows containers to use the embedded default profile if a different
default is set (e.g. "unconfined") in the daemon configuration. Without this
option, users would have to copy the default profile to a file in order to
use the default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 15:40:47 +02:00
Sebastiaan van Stijn
68e96f88ee
Fix daemon.json and daemon --seccomp-profile not accepting "unconfined"
Commit b237189e6c implemented an option to
set the default seccomp profile in the daemon configuration. When that PR
was reviewed, it was discussed to have the option accept the path to a custom
profile JSON file; https://github.com/moby/moby/pull/26276#issuecomment-253546966

However, in the implementation, the special "unconfined" value was not taken into
account. The "unconfined" value is meant to disable seccomp (more factually:
run with an empty profile).

While it's likely possible to achieve this by creating a file with an an empty
(`{}`) profile, and passing the path to that file, it's inconsistent with the
`--security-opt seccomp=unconfined` option on `docker run` and `docker create`,
which is both confusing, and makes it harder to use (especially on Docker Desktop,
where there's no direct access to the VM's filesystem).

This patch adds the missing check for the special "unconfined" value.

Co-authored-by: Tianon Gravi <admwiggin@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 15:40:45 +02:00
Sebastiaan van Stijn
ac449d6b5a
daemon/config: rename the default seccomp profile to "builtin"
Using "default" as a name is a bit ambiguous, because the _daemon_ default
can be changed using the '--seccomp-profile' daemon flag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 15:37:03 +02:00
Sebastiaan van Stijn
ee02257553
Add const for "unconfined" and default seccomp profiles
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-07 15:36:06 +02:00
Sebastiaan van Stijn
a6dd341ca2
client: remove deprecated SetCustomHTTPHeaders(), CustomHTTPHeaders()
Both of these function were added in a754d89b40.

The CustomHTTPHeaders() was not used, except for a unit test in docker/cli (this
test has already been updated to not depend on this function);
https://grep.app/search?q=.CustomHTTPHeaders%28%29&filter[lang][0]=Go

Commit a68ae4a2d9 deprecated SetCustomHTTPHeaders(),
and looks to be unused; https://grep.app/search?q=.SetCustomHTTPHeaders%28&filter[lang][0]=Go

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-06 19:33:44 +02:00
Sebastiaan van Stijn
8afb57e633
client: deprecate client.CustomHTTPHeaders()
This function was added in a754d89b40, but not
used. Currently, the only consumer of this function I could find was docker/cli,
which used it in a unit-test (this test has already been updated to not depend
on this function); https://grep.app/search?q=.CustomHTTPHeaders%28%29&filter[lang][0]=Go

Given that commit a68ae4a2d9 deprecated the
corresponding client.SetCustomHTTPHeaders() function, and because there is no
active use for this function, it should be ok to deprecate.

We can include this in a patch-release (to be sure nobody else is depending on
it, and (if someone is) to notify them of the deprecation.

As a follow-up to this commit, I'll remove both functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-06 19:33:41 +02:00
Roman Volosatovs
0fdd23b7fe
API: discard /system/df type parameter pre-1.42
The parameter is introduced in API version 1.42

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-08-06 19:33:16 +02:00
Sebastiaan van Stijn
6948ab4fa1
api/types: hostconfig: fix LogMode enum
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-06 19:05:58 +02:00
Sebastiaan van Stijn
5ae1c1f4cf
api/types: hostconfig: clean up enum for Isolation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-06 19:05:56 +02:00
Sebastiaan van Stijn
09cf117b31
api/types: hostconfig: create enum for CgroupnsMode
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-06 19:05:54 +02:00
Sebastiaan van Stijn
98f0f0dd87
api/types: hostconfig: define consts for IpcMode
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-06 19:05:51 +02:00
Sebastiaan van Stijn
5e498e20f7
Merge pull request #42710 from rvolosatovs/parallelize_system_df
daemon: paralellize disk usage computations
2021-08-06 09:55:51 +02:00
Brian Goff
6a60efc39b
Merge pull request #42684 from thaJeztah/remove_lcow_step7
Remove LCOW (step 7): remove LCOW bits from builder/dockerfile (copy)
2021-08-05 15:16:24 -07:00
Samuel Karp
8b43104937
Merge pull request #42672 from thaJeztah/pkg_archive_debuglogs 2021-08-05 12:04:59 -07:00
Tianon Gravi
11fb1ba0c6
Merge pull request #42685 from thaJeztah/remove_lcow_step8
Remove LCOW (step 8): libcontainerd/local: remove LCOW bits
2021-08-05 11:50:48 -07:00
Roman Volosatovs
a18cf3e4ef
daemon: paralellize disk usage computations
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-08-05 14:42:31 +02:00
Tianon Gravi
deda3d4933
Merge pull request #42708 from AkihiroSuda/rootlesskit-0.14.4
bump up rootlesskit to v0.14.4
2021-08-04 16:24:11 -07:00
Sebastiaan van Stijn
58c4c120a8
oci/caps: simplify, and remove types that were not needed
The `CapabilityMapping` and `Capabilities` types appeared to be only
used locally, and added unneeded complexity.

This patch removes those types, and simplifies the logic to use a
map that maps names to `capability.Cap`s

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-04 11:25:55 +02:00
Sebastiaan van Stijn
fc3f98848a
oci/caps: improve error message for unsupported capabilities
A capability can either be invalid, or not supported by the kernel
on which we're running. This patch changes the error message produced
to reflect if the capability is invalid/unknown, or a known capability,
but not supported by the kernel version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-04 11:25:53 +02:00
Sebastiaan van Stijn
72b1fb59fe
oci/caps: use map for capabilities to simplify lookup
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-04 11:25:51 +02:00
Sebastiaan van Stijn
d786a52364
oci/caps: generate list of all capabilities on "init"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-04 11:25:48 +02:00
Sebastiaan van Stijn
0ec6f7ea23
oci/caps: minor optimization in init
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-04 11:25:44 +02:00
Sebastiaan van Stijn
b00b21b93c
oci/caps: rename some vars that conflicted with imports / built-ins
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-04 11:24:40 +02:00
Sebastiaan van Stijn
94334153b5
oci/caps: remove hack for RHEL6 kernels
We no longer support these kernels, so we can remove the workaround

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-04 11:23:56 +02:00
Sebastiaan van Stijn
e6a3313f16
Merge pull request #42011 from thaJeztah/remove_capabilities_hack
Revert "Temporarily disable CAP_PERFMON, CAP_BPF, and CAP_CHECKPOINT_RESTORE
2021-08-04 11:15:09 +02:00
Akihiro Suda
9499acc360
bump up rootlesskit to v0.14.4
Fixes `panic: tap2vif: read: read /dev/net/tun: not pollable` on early
start up of RootlessKit with VPNKit.

Changes:
- https://github.com/rootless-containers/rootlesskit/releases/tag/v0.14.4
- https://github.com/rootless-containers/rootlesskit/releases/tag/v0.14.3

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-04 16:34:09 +09:00
Samuel Karp
52af466716
Merge pull request #42594 from rvolosatovs/fix_concurrency_test
hack/test/unit: run `libnetwork` tests sequentially
2021-08-03 09:52:02 -07:00
Sebastiaan van Stijn
0c88b0dc82
Merge pull request #42618 from thaJeztah/remove_common_unix_config
daemon/config: remove commonUnixBridgeConfig and CommonUnixConfig
2021-08-03 16:52:10 +02:00
Sebastiaan van Stijn
c1c973e81b
Revert "Temporarily disable CAP_PERFMON, CAP_BPF, and CAP_CHECKPOINT_RESTORE"
Now that runc v1.0.0-rc93 is used, we can revert this temporary workaround

This reverts commit a38b96b8cd.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-03 16:12:31 +02:00
Sebastiaan van Stijn
2480bebf59
Merge pull request #42649 from kinvolk/rata/seccomp-default-errno
seccomp: Use explicit DefaultErrnoRet
2021-08-03 15:13:42 +02:00
Sebastiaan van Stijn
7672963eec
Merge pull request #42703 from rvolosatovs/fix_network_db_test
libnetwork: wait until t.Deadline() instead of hardcoded value
2021-08-03 15:12:27 +02:00
Roman Volosatovs
3af2217dc4
hack/test/unit: run libnetwork tests sequentially
Run all tests within `libnetwork` namespace with `-p=1`
in a separate `gotestsum` invocation.

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-08-03 12:19:49 +02:00
Sebastiaan van Stijn
656a5e2bdf
Merge pull request #42559 from rvolosatovs/system_df_types
Add `type` parameter to `/system/df`
2021-08-02 21:03:05 +02:00
Sebastiaan van Stijn
bca9f60845
Merge pull request #42697 from thaJeztah/update_containerd_1.5.5
Update to containerd v1.5.5
2021-08-02 09:58:10 +02:00
Roman Volosatovs
b821590461
libnetwork/networkdb: consistently wait for nodes in tests
Use `verifyNetworkExistence` like it was done in 2837fba75f

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-08-01 17:47:51 +02:00
Roman Volosatovs
8fbba73f42
libnetwork: wait until t.Deadline() instead of hardcoded value
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-08-01 17:47:50 +02:00
Sebastiaan van Stijn
0b39cc2e57
Merge pull request #42623 from thaJeztah/remove_containerd_from_client
Remove containerd "platform" dependency from client
2021-07-31 18:45:29 +02:00