Commit graph

43070 commits

Author SHA1 Message Date
Sebastiaan van Stijn
f68260ba22
Dockerfile: frozen images: update to bullseye, remove buildpack-dep
Update the frozen images to also be based on Debian bullseye. Using the "slim"
variant (which looks to have all we're currently using),  and remove the
buildpack-dep frozen image.

The buildpack-dep image is quite large, and it looks like we only use it to
compile some C binaries, which should work fine on a regular debian image;

    docker build -t debian:bullseye-slim-gcc -<<EOF
    FROM debian:bullseye-slim
    RUN apt-get update && apt-get install -y gcc libc6-dev --no-install-recommends
    EOF

    docker image ls

    REPOSITORY        TAG                 IMAGE ID       CREATED          SIZE
    debian            bullseye-slim-gcc   1851750242af   About a minute ago   255MB
    buildpack-deps    bullseye            fe8fece98de2   2 days ago           834MB

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 18:23:06 +02:00
Sebastiaan van Stijn
1effe7435a
Dockerfile: add back libseccomp-dev to cross-compile runc
commit 7168d98c43 removed these, but
we overlooked that the same stage is used to build runc as well, so
we likely need these.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 18:23:04 +02:00
Sebastiaan van Stijn
43c6a3d359
Dockerfile: update to debian bullseye
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 18:22:57 +02:00
Sebastiaan van Stijn
7e67bc067f
integration/libnetwork: make delInterface() a t.Helper()
Otherwise errors within this function will all show to be at the line
number of the utility, instead of where it failed in the test:

    === RUN   TestDaemonDefaultNetworkPools
        service_test.go:23: assertion failed:
            Command:  ip link delete docker0
            ExitCode: 127
            Error:    exec: "ip": executable file not found in $PATH
            Stdout:
            Stderr:

            Failures:
            ExitCode was 127 expected 0
            Expected no error

    === RUN   TestDaemonRestartWithExistingNetwork
        service_test.go:23: assertion failed:
            Command:  ip link delete docker0
            ExitCode: 127
            Error:    exec: "ip": executable file not found in $PATH
            Stdout:
            Stderr:

            Failures:
            ExitCode was 127 expected 0
            Expected no error

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 13:33:13 +02:00
Sebastiaan van Stijn
3ab8decad7
Dockerfile: remove aufs-tools, as it's not available on bullseye
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 13:33:11 +02:00
Sebastiaan van Stijn
882fd19f39
Dockerfile: update to docker/dockerfile:1.3, and remove temporary fix
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 13:33:09 +02:00
Sebastiaan van Stijn
5ea3e12b63
Merge pull request #42755 from thaJeztah/move_resolvconf_consts
libnetwork: make resolvconf more self-contained
2021-08-20 10:05:29 +02:00
Sebastiaan van Stijn
d215d3477b
libnetwork/resolvconf: remove README.md
This information was already documented in the package's GoDoc, so
no need to repeat it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:35:43 +02:00
Sebastiaan van Stijn
98caf09f0f
fix go-digest to make sure the algorithms are registered
Previously, ioutils imported the crypty/sha256 package, because it was
used by the HashData() utility. As a side-effect of that import, the
sha256 algorithm was registered through its `init()` function.

Now that the HashData() utility is removed, the import is no longer needed
in this package, but some parts of our code depended on the side-effect, and
without this, it fail to recognise the algorithms, unless something else
happens to import crypto/sha256 / crypto/sha512, which made our
tests fail:

```
=== Failed
=== FAIL: reference TestLoad (0.00s)
    store_test.go:53: failed to parse reference: unsupported digest algorithm

=== FAIL: reference TestSave (0.00s)
    store_test.go:82: failed to parse reference: unsupported digest algorithm

=== FAIL: reference TestAddDeleteGet (0.00s)
    store_test.go:174: could not parse reference: unsupported digest algorithm

=== FAIL: reference TestInvalidTags (0.00s)
    store_test.go:355: assertion failed: error is not nil: unsupported digest algorithm
```

While it would be better to do the import in the actual locations where it's
expected, there may be code-paths we overlook, so instead adding the import
here temporarily. Until the PR in go-digest has been merged and released.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:35:41 +02:00
Sebastiaan van Stijn
572498be56
move pkg/ioutils.HashData() to libnetwork/resolvconf
It's the only location it's used, so we might as well move it there.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:35:39 +02:00
Sebastiaan van Stijn
c21be64e1a
libnetwork: remove resolvconf/dns package
The IsLocalhost utility was not used, which only leaves the IsIPv4Localhost
utility.

Go's "net" package provides a `IsLoopBack()` check, but it checks for both
IPv4 and IPv6 loopback interfaces. We likely should also do IPv6 here, but
that's better left for a separate change, so instead, I replicated the IPv4
bits from Go's net.IP.IsLoopback().

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:35:34 +02:00
Sebastiaan van Stijn
c9ba301a49
libnetwork: move resolvconf consts into the resolvconf package
This allows using the package without having to import the "types" package,
and without having to consume github.com/ishidawataru/sctp.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:23:43 +02:00
Sebastiaan van Stijn
b6919cb553
Merge pull request #42756 from thaJeztah/remove_unused_testutils_imports
libnetwork: remove unused "testutils" imports
2021-08-19 22:00:56 +02:00
Akihiro Suda
f95be5e2f3
Merge pull request #42510 from thaJeztah/proxy_cleanup
libnetwork/portmapper: some minor cleaning up
2021-08-19 19:02:09 +09:00
Akihiro Suda
8360de9955
Merge pull request #42673 from thaJeztah/regex_optimisation
volume/mounts: pre-compile regular expressions
2021-08-19 19:00:19 +09:00
Sebastiaan van Stijn
427ad30c05
libnetwork: remove unused "testutils" imports
Perhaps the testutils package in the past had an `init()` function to set up
specific things, but it no longer has. so these imports were doing nothing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-18 14:20:37 +02:00
Aaron Lehmann
ba2adeebdb
Merge pull request #42676 from aaronlehmann/patternmatcher-doublestar-bug
fileutils: Fix incorrect handling of "**/foo" pattern
2021-08-16 19:58:55 -07:00
Aaron Lehmann
c44b90f3bf Test fix for Windows compatibility
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-08-12 20:03:41 -07:00
Aaron Lehmann
97ede9df26 Rename Matches to MatchesOrParentMatches
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-08-12 18:10:04 -07:00
Aaron Lehmann
9bae4f2f24 Add more optimal MatchesUsingParentResult method, use it in pkg/archive
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-08-12 13:57:50 -07:00
Brian Goff
385ddf6120
Merge pull request #42730 from thaJeztah/update_api_changelog
docs/api: add node about concurrency on /system/df endpoint
2021-08-12 12:00:52 -07:00
Brian Goff
9e5e846c8e
Merge pull request #42737 from thaJeztah/integratione_network_remove_duplicate_code
integration/network: remove dead code
2021-08-12 11:38:44 -07:00
Sebastiaan van Stijn
56e5fee2ad
Merge pull request #42720 from thaJeztah/bump_go_1.16.7
Update Go to 1.16.7
2021-08-12 13:17:37 +02:00
Sebastiaan van Stijn
002b38dc36
integration/network: remove unused CheckKernelMajorVersionGreaterOrEqualThen
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-12 09:16:21 +02:00
Sebastiaan van Stijn
8a25d752a9
integration/network: remove IsUserNamespace in favor of testenv equivalent
We're already using testenv here, so might as well use the exact same
function that it provides.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-12 09:12:04 +02:00
Brian Goff
7681a3eb40
Merge pull request #42481 from thaJeztah/seccomp_unconfined_daemon 2021-08-11 10:02:05 -07:00
Sebastiaan van Stijn
343665850e
Merge pull request #42201 from AkihiroSuda/annotate-btrfs-error
rootless: btrfs: annotate error with human-readable hint string
2021-08-11 16:12:59 +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
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
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